正在加载图片...
Sorting Quicksort Quicksort Q:What are the SIMILARITIES and DIFFERENCES between Quicksort and Mergesort? QUICKSORT(A,p.r) MERGE-SORT(A,p,r) 1 if p<r 1 ifp<r 2 q=PARTITION(A,P,r) 2 9=L(p+r)/2 3 QUICKSORT(A,p.q-1) 3 MERGE-SORT(A,p,q) 4 QUICKSORT(A.q +1,r) 4 MERGE-SORT(A,q+1,r) 5 MERGE(A,p,q,r) 美 Ma Jun (Institute of Computer Software) Problem Solving April 19,2022 2/42Sorting Quicksort Quicksort Q : What are the SIMILARITIES and DIFFERENCES between Quicksort and Mergesort? VS Similarity: both are divide-and-conquer strategies. Difference: the process QuickSort MergeSort Partition hard easy Combination easy hard Ma Jun (Institute of Computer Software) Problem Solving April 19, 2022 2 / 42
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有