01:198:107 Study Guide - Final Guide: Condition Number, Insertion Sort, Artery Recordings

113 views18 pages

Document Summary

Cell arrays and text file i/o 15. We don(cid:859)t (cid:396)eall(cid:455) (cid:374)eed t(cid:449)o (cid:448)e(cid:272)to(cid:396)s, u(cid:374)so(cid:396)ted a(cid:374)d so(cid:396)ted - we can keep all the data in one vector. We might find the right place early. Note the cost of moving things in addition to comparing. If vector already close to sorted, takes much less than length^2. Key idea: swap smallest unsorted and first unsorted. Cannot make use of partial pre-sorting: worse average case. Can make use of partially sorted list: better average case. Groups are number > pivot, < pivot. Scan from small indexes looking for a number > pivot. Scan from large indexes looking for a number < pivot. Assuming each split is into halves: log(n) sizes. Work to split or join pieces is proportional to size of the piece. If pieces are of size k we have n/k of them. For quicksort we assumed each split was in halves, but this depends on pivot.

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