Can we find the index of any value in "set" data structrure?

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.

No, but you can use this.

1 Like

All these STLs work in O(N) so it is not commonly used .

1 Like

What is linear? insert() and order_of_key(), are both logarithmic.

1 Like