Sidechat icon
Join communities on Sidechat Download
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
upvote 3 downvote

default user profile icon
Anonymous 3w

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

upvote 1 downvote
default user profile icon
Anonymous 3w

But my interviewer kept pressing on that, and it was just super unclear what sort of answer he was looking for

upvote 1 downvote
default user profile icon
Anonymous 3w

If anyone could give any insight, that would be much appreciated.

upvote 1 downvote
default user profile icon
Anonymous replying to -> OP 3w

Like i know that merge sort is stable, but i have no idea what they were looking for

upvote 1 downvote