InterviewSolution
| 1. |
Describe the merge sort algorithm. |
|
Answer» Merge sort (ALSO known as MERGESORT) is a general-purpose, comparison-based sorting algorithm developed in computer science. The majority of its implementations result in a stable sort, which indicates that the order of equal elements in the input and output is the same. In 1945, John von Neumann DEVISED the merge sort method, which is a divide and conquer algorithm. The following is how a merge sort WORKS conceptually:
The time complexity of the Merge Sort Algorithm is O(nlog(n)) where n is the size of the list of the elements to be sorted while the space complexity of the Merge Sort Algorithm is O(n), that is, linear space complexity. |
|