max_size(): This is a build-in function in STL. This function returns the maximum
size of the set.
This function is available in the below file.
File: stl_set.h
Parameters: No parameters are required for this function.
Syntax:
st.max_size()
For Example:
st = {1,2,3,4}
st.max_size() = > It returns max_size (i.e 461168601842738790)
Approach
C++
#include <bits/stdc++.h>using namespace std;int main(){set<int> st;st.insert({1, 2, 4, 3});cout << st.max_size() << "\n";return 0;}
No comments:
Post a Comment