LearnFrenzy
Sign in Take a free test

STL Algorithms and Iterators · STL Algorithms MCQ · Question 5

What does stable_sort guarantee? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 5 Back to Exercise

What does std::stable_sort guarantee that std::sort does not?

  • A It is faster
  • B Equal elements keep their original relative order Correct
  • C It sorts in descending order
  • D It uses no extra memory
Correct Answer: Option B

Useful when sorting by one key after another.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links