Need help with Multiset with random-access iterators in C++

Revision en2, by scopeInfinity, 2018-06-22 09:09:31

I was going through a blog (https://cp-algorithms.com/data_structures/segment_tree.html )

It says something like -

The query function is also almost equivalent, only now the lower_bound function of the multiset function should be called instead (std::lower_bound only works in O(logn) time if used with random-access iterators).

I need some help, to clarify few doubts(might help others too) —

  • How can I define multiset with random-access iterators in C++?
  • Can we find the rank of an element using it?
  • How is it different from "C++ STL: Policy based data structures"?
Tags #c++, iterator, ordered_set, #multiset

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English scopeInfinity 2018-06-22 09:09:31 25 Tiny change: ' a blog ( ![https://c' -> ' a blog ( [Your text to link here...](a)[https://c' (published)
en1 English scopeInfinity 2018-06-22 09:07:24 695 Initial revision (saved to drafts)