← BYTES
Algorithms·Starter·Ref: 12.1.11
What does it mean for a sorting algorithm to be 'stable'?
Have a question about this video? Mention reference 12.1.11 when you contact us.
a.Elements with equal keys retain their original relative order in the sorted output
b.It never crashes on large inputs
c.It always runs in O(n log n) time
d.It sorts in-place with no extra memory
Stability matters when sorting by one field while other fields differ -- e.g., sorting people by last name should leave two people with the same last name in whatever order they appeared before sorting. Merge sort is typically stable; a naive quicksort implementation typically is not.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES12111#Algorithms