how to find minimum value in set
Answers
Answered by
0
Step-by-step explanation:
Find Maximum and Minimum element in a Set in C++ STL
1.Using set.begin() and set.end() methods. Approach: Elements in a set are stored in sorted order. So the minimum element of the set will reside in the first element and the maximum element in the last element.
2.Using set.rbegin() and set.rend() methods. Approach: Elements in a set are stored in sorted order.
Similar questions