Lecture 4 Quick Sort and Randomized Quick Sort
生活随笔
收集整理的這篇文章主要介紹了
Lecture 4 Quick Sort and Randomized Quick Sort
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Quick Sort
--Divide and Conquer
--Sorts “in place”
--Very practical with tuning
Divide and Conquer:
1.Divide: Partition array into 2 sub-arrays around pivot x such that?elements in lower sub-array <= x <= elements in upper sub-array;
2.Conquer: Recursively sort 2 sub-arrays;
3.Combine: Trivial.
Randomized Quick sort:
--running time is independent of input ordering.
--no assumption about input distribution.
--no specific input elicit the worst-case behavior.
--the worst case determined only by random number generator.
總結
以上是生活随笔為你收集整理的Lecture 4 Quick Sort and Randomized Quick Sort的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Lecture 3 Divide an
- 下一篇: Lecture 6 Order Sta