Had an interview where i got asked to show that merge sort is stable, and it was so fucking weird. The example was if you already two sorted half that you’re trying to merge, and the interviewer was asking about if you get the two halves in a different
Order, wouldn’t it switch up the order, and i was saying that shouldn’t be happening if we just fix the order, but it was so weird. Like this shouldn’t be happening, if the second half is first, it’s not the second half anymore
1
Anonymous3w
But my interviewer kept pressing on that, and it was just super unclear what sort of answer he was looking for
1
Anonymous3w
If anyone could give any insight, that would be much appreciated.
1
AnonymousOP3w
Like i know that merge sort is stable, but i have no idea what they were looking for