eg. suppose I have a set with values
1 2 8 12 15 32 100
and I want to find the index of 12 which is “3” .
Can we use upper bound or lower bound in set(can we get the index) of that value.
eg. suppose I have a set with values
1 2 8 12 15 32 100
and I want to find the index of 12 which is “3” .
Can we use upper bound or lower bound in set(can we get the index) of that value.
All these STLs work in O(N) so it is not commonly used .
What is linear? insert()
and order_of_key()
, are both logarithmic.