Merging two sorted lists consumes one head per comparison and takes time in their combined length, assuming constant-cost comparisons. Computing the length and splitting also takes time. The balanced recursion therefore satisfiesEach recursion level has total linear work, and there are levels. Thus merge sort takes worst-case time. The final
map snd adds , preserving the bound. Costs of comparing variable-size keys must be included separately. Articles by others on the same topic
There are currently no matching articles.