COMP 352 Lecture Notes - Lecture 20: Radix Sort, Quicksort, Merge Sort

120 views4 pages

Document Summary

Quick sort, in-place quick sort, hybrid quick sort, bucket- Runs faster than heap sort (based on expected runtime) In this case insertion sort is ideal for small inputs. The sizes of l and g are each less than 3s/4 (similar) There is 1/2 chances of getting a good call. One of l and g has size greater than 3s/4. Move l to the right until you find an element > 6 (pivot) a. b. Move r to the left until you find an element < 6 (pivot) a. b. Repeat process 4 and 5 until the l and r have crossed, then you stop a. b. Now the array will be partitioned into l and upper will be r. You need the whole input at same time. You stop the recursion before the size becomes 1 (reasonable value) Example, when input size becomes 100 commence insertion sort operation. When input size becomes small you apply insertion-sort.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents