CPSC 319 Lecture Notes - Lecture 4: Quicksort, Array Data Structure, Selection Sort

86 views7 pages

Document Summary

Internal sort: data is kept in primary memory i. e. in ram, using arrays. External sort: data is kept in secondary storage i. e. on disk or tape: usually requires special sorting techniques. In-place sort: a sort achieved by exchanging items in place within an array i. e. does not use extra memory: some sorts use extra memory for speed reasons. Stable sort: a sort that preserves the relative order of equal keys: e. g. Sort a list of people first by name, then by age. Ensures that people of the same age remain in alphabetic order. Is usually done by considering the number of: comparisons, data movements i. e. exchanges or swaps . The efficiency of a sort may depend on the initial ordering of data. We measure the number of comparisons and data movements for the: best case: data already in order, worst case: data in reverse order, average case: data in random order.

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