Ems: an enhanced merge sort algorithm by early checking of already sorted parts

International Journal of Software Engineering and Computer Systems(2019)

引用 0|浏览1
暂无评分
摘要
Merge sort is one of the asymptotically optimal sorting algorithms that is used in many places including programming language library functions and operating systems. In this paper, we give a modified version of merge sort, which in practice shows substantial improvement in running time than the top-down and bottom-up implementations of the classical merge sort. Our algorithm works as a bottom-up manner and the modifications happen in three places: (a) given n elements in an array, first the algorithm considers the array as n / 2 consecutive pairs and sorts each pair in-place by one comparison; (b) in subsequent steps, during the ”merge” process of two subarrays, if the last element in the left subarray is smaller than the first element in the right subarray, the algorithm simply returns; and (c) if the last element in the right subarray is smaller than the first element in the left subarray, then the algorithm swaps the elements in the two subarrays by their entirety. Steps (b) and (c) happen in-place. For the case not in (b) or (c), the algorithm follows the classical merge technique with an extra array. Our experimental results also show that case (b) and (c) happen a good amount of time in practice and that is the reason that our algorithm gives better running time than the classical merge sort.
更多
查看译文
关键词
enhanced merge sort algorithm,early checking
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要