Merge sort is a divide and conquer algorithm that has a lower order running time than the insertion sort. The merge sort algorithm works by using recursion; it will repeatedly divide an unsorted list into two halves. When the list has a single item or it is empty it is considered sorted; this is called the base case. The majority of the sorting work is performed in the merge
function, which is responsible for combining the two halves back together. The merge
function uses a temporary array of equal size to the input array during the merge process so it has a higher order auxiliary space of O(n). Because of this, merge sort is generally better off implemented for sorting a linked list instead of an array. We'll look at both implementations so you can see the performance differences based on the dataset size.
Argentina
Australia
Austria
Belgium
Brazil
Bulgaria
Canada
Chile
Colombia
Cyprus
Czechia
Denmark
Ecuador
Egypt
Estonia
Finland
France
Germany
Great Britain
Greece
Hungary
India
Indonesia
Ireland
Italy
Japan
Latvia
Lithuania
Luxembourg
Malaysia
Malta
Mexico
Netherlands
New Zealand
Norway
Philippines
Poland
Portugal
Romania
Russia
Singapore
Slovakia
Slovenia
South Africa
South Korea
Spain
Sweden
Switzerland
Taiwan
Thailand
Turkey
Ukraine
United States