Search
 
SCRIPT & CODE EXAMPLE
 

CPP

difference between lower and upper bound

//a={10, 20, 30, 30, 40, 50, 60}

std::lower_bound returns iterator to first element in the given range 
-which is EQUAL_TO or Greater than val.
//*a.lower_bound(30) = 30 , *a.lower_bound(40) = 40, a.lower_bound(45) = 50     

std::upper_bound returns iterator to first element in the given range 
-which is Greater than val.
//*a.upper_bound(30) = 40 , *a.upper_bound(40) = 50, a.upper_bound(45) = 50

note:- * return the value assoiciated with the iterator;
credit:- for def. user13003546(stackoverflow)
Comment

PREVIOUS NEXT
Code Example
Cpp :: character array to string c++ stl 
Cpp :: prints out the elements in the array c++ 
Cpp :: c++ program to find prime number using function 
Cpp :: max function in c++ 
Cpp :: c++ code for quicksort 
Cpp :: cpp list 
Cpp :: Frequency of a substring in a string C++ 
Cpp :: c++ type casting 
Cpp :: substring to int c++ 
Cpp :: c++ cin operator 
Cpp :: sort vector using marge sorting in c++ 
Cpp :: two pointer in c++ 
Cpp :: delete one specific character in string C++ 
Cpp :: string stream in c++ 
Cpp :: c++ init multidimensional vector 
Cpp :: c++ get environment variable 
Cpp :: c++ 
Cpp :: clear the input buffer in cpp 
Cpp :: int to hex arduino 
Cpp :: input in c++ 
Cpp :: c++ friend class 
Cpp :: console colors in C++ 
Cpp :: fast way to check if a number is prime C++ 
Cpp :: who to include a library c++ 
Cpp :: c++ double is nan 
Cpp :: concatenate two vectors c++ 
Cpp :: unique_ptr syntax 
Cpp :: c++ int length 
Cpp :: c preprocessor operations 
Cpp :: c++ hello world linux 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =