Imagine a scenario where you have to maintain a collection of elements while keeping them sorted after insertions and deletions. Which STL container would be the most efficient choice for this task? 

  • vector 
  • list 
  • set 
  • queue
The STL set container maintains its elements in sorted order by keys. It automatically reorders itself after insertions and deletions, making it the most efficient choice for maintaining a sorted collection without requiring manual reordering.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *