Sort an almost-sorted, k-sorted or nearly-sorted array
Sort an almost-sorted, k-sorted or nearly-sorted array sits in the roll list. Vikram’s job is names A→Z. Write that first.
Sort an almost-sorted, k-sorted or nearly-sorted array order: meaning → n log n vs n² → one limit. Dumping ten features helps nobody.
Sort an almost-sorted, k-sorted or nearly-sorted array exists so Vikram can keep names A→Z correct in the roll list.
Use Sort an almost-sorted, k-sorted or nearly-sorted array when names A→Z must stay clear. If a simpler DSA step works, use that instead.
Don’t do this with Sort an almost-sorted, k-sorted or nearly-sorted array: unstable sort when equal keys matter. Interviewers spot it in ten seconds.
After Sort an almost-sorted, k-sorted or nearly-sorted array, Vikram should still remember unstable sort when equal keys matter.
One breath for Sort an almost-sorted, k-sorted or nearly-sorted array, then names A→Z, then unstable sort when equal keys matter. Sit down.
index → 0 1 2 array → [10, 20, 30]
Say Sort an almost-sorted, k-sorted or nearly-sorted array in one breath, then n log n vs n², then unstable sort when equal keys matter.