AStableComparison-basedSortingAlgorithmwithworst.docVIP

  • 4
  • 0
  • 约1.58万字
  • 约 5页
  • 2017-05-05 发布于湖北
  • 举报

AStableComparison-basedSortingAlgorithmwithworst.doc

AStableComparison-basedSortingAlgorithmwithworst

A Stable Comparison-based Sorting Algorithm with worst Case complexity of O(n log n) Comparisons and O(n) Moves Hanan Ahmed-Hosni Mahmoud, and Nadia Alghreimil Abstract—stable sorting algorithms maintain the relative order of records with equal keys. Such algorithms are required in fields of computer science such as databases applications. A Stable Comparison-based Sorting Algorithm with worst Case complexity of O(n log n) Comparisons and O(n) Moves. The algorithm comprises two phases; stable rearranging of the input unsorted array into m sorted subarrays, and then K- way merge the sorted subarrays producing an output sorted array in the second phase. The first phase requires linear time, while, in the second phase, the K-way merge requires . The algorithm performs, in the worst case, for an array of size n, an O(n log n)) element comparisons and O(n log n))) element moves. There are no auxiliary arithmetic operations with indices are required. Experimental results show that it outperforms other stable sorting algorithms. Finally, the Analysis of time and space complexity, and required number of moves are presented, along with the auxiliary storage requirements of the proposed algorithm. Keywords—Stable sorting , auxiliary storage sorting, Sorting. I. INTRODUCTION Sorting is one of the most fundamental problems in the field of computer science[1],[2]. Comparison-based algorithms perform, in the average case, at least log n! ≈ n · log n ?n · log e ≈ n · log n ?1.443n comparisons to sort an array of n elements [2],[3]. The lower bound for element moves is n log (n). The merge sort Algorithm performs very closely to the optimum, with n log (n) comparisons [2],[4]. However, the merge sort is not a stable algorithm. The binary-search version of insert sort requires log n!+n comparisons, and only O(1) index variables; of log n bits each, for pointing to the input array [8],[9],[10]. However, the algorithm performs _(n2) element moves, which makes it very slo

文档评论(0)

1亿VIP精品文档

相关文档