Yhdistämisjärjestämistapa
Yhdistämisjärjestämistapa, often translated as merge sort, is a comparison-based sorting algorithm. It follows the divide and conquer paradigm. The algorithm recursively divides an unsorted list into n sublists, each containing one element. Then, it repeatedly merges sublists to produce new sorted sublists until there is only one sublist remaining. This final sublist is the sorted version of the initial list.
The core of merge sort lies in its merge step. Two sorted sublists are combined into a
Merge sort is known for its stability, meaning that elements with equal values maintain their relative order