Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

lower and upper bound c++

Iterator lower_bound (Iterator first, Iterator last, const val) 
lower_bound returns an iterator pointing to the first element in the range [first,last) which has a value not less than ‘val’. 

Iterator upper_bound (Iterator first, Iterator last, const val) 
upper_bound returns an iterator pointing to the first element in the range [first,last) which has a value greater than ‘val’.         
                                                                            
If the value is not present in the vector then it returns the end iterator.
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #upper #bound
ADD COMMENT
Topic
Name
4+9 =