J4 ›› 2014, Vol. 36 ›› Issue (01): 115-120.
• 论文 • Previous Articles Next Articles
BAI Yu,GUO Xiane
Received:
Revised:
Online:
Published:
Abstract:
Singly linked list is widely used for the dynamic storage structure, the current singly linked list sorting algorithms generally have low efficiency, and the QuickSort algorithm with the highest average efficiency is inapplicable to singly linked list. Based on the divide and conquer strategy and the recursive method, through relinking the nodes of singly linked list, the paper proposes the QuickSort algorithm for singly linked list. Its average time complexity is O(nlog2n), its auxiliary space complexity is O(0), and its average space complexity of recursion stack is O(log2n). Algorithm analysis and experimental testing are conducted. The results show that its efficiency improves greatly over the other singly linked list sorting algorithms and more traditional QuickSort algorithm based on linear array. We can conclude that the proposed algorithm solves the inefficient problem on singly linked list sorting.
Key words: singly linked list;QuickSort;inplace sort;divide and conquer strategy
BAI Yu,GUO Xiane. QuickSort algorithm for singly linked list [J]. J4, 2014, 36(01): 115-120.
0 / / Recommend
Add to citation manager EndNote|Ris|BibTeX
URL: http://joces.nudt.edu.cn/EN/
http://joces.nudt.edu.cn/EN/Y2014/V36/I01/115