这个 无序集合::最大大小() 是C++中的一个内置函数,定义在
null
语法 :
map_name.max_size()
参数: 此函数不接受任何参数。它只返回容器的最大大小。
返回值: 此函数返回无序_集可以容纳的最大元素数。
例外 :此函数不会引发任何类型的异常。
下面的程序演示了C++中无序的_set::max_size()函数:
// C++ program to illustrate the // unordered_set::max_size function #include <iostream> #include <unordered_set> using namespace std; int main() { // declaration unordered_set< int > sample; // Get the maximum size of the unordered_set cout << sample.max_size(); return 0; } |
输出
1152921504606846975
时间复杂性 :O(1)
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END