AlgoFrames

Stability

Warm-up · Multiple choice · about 4 min

Heap sort sorts the cards 5a, 5b, 3 by number only. The letters just tell the two 5s apart. Which result does heap sort give, and what does it show?

Example 1

Input:

{"values":["5a","5b","3"]}

Output:

["3","5b","5a"]

Learn the idea first: Heap sort, a visual lesson.

More Heap sort problems