This question has already been answered:

Does anyone have any idea how to make merge sorting not by recursion, but by iteration?

Reported as a duplicate by Abyx members, Vladimir Martyanov , aleksandr barakin , Pavel Parshin , PashaPash 3 Feb '16 at 17:44 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

    1 answer 1

    Simple option:

    • Divide into arrays by one element and put them in a queue.
    • Extract two items from the queue, merge it into one and put it back in the queue
    • Repeat until 1 item remains in the queue.
    • Yes, yes, exactly how I forgot about the turn) Thank you! - nicolai