Amdocs interview question

merge sort heap sort puzzle