CSE 331 Study Guide - Fall 2018, Comprehensive Midterm Notes - Algorithm, Time, Memory Management

98 views31 pages
12 Oct 2018
School
Course
Professor

Document Summary

Types of sorts: comparison sorts: compares two elements at a time, elements must form a consistent, total ordering, compareto() must work for the elements, best runtime is o(nlog(n), niche sort: also called linear sorts. Leverages specific properties about the items in the list to achieve faster runtimes: runs on o(n) Then loop through to find where to insert: best case runtime is o(n)(when list is already sorted), which almost never occurs. It is an unstable sort algorithm, depending on how the algorithm is implemented. It is an inplace algorithm: selection sort: similar to insertion sort, where you insert items where it belongs. So you can use a max heap instead: divide and conquer: idea of dividing the work into smaller pieces recursively and then conquer those pieces, merge sort: divides the list into half, then continue breaking it down. Recursively divide each parts into less than and greater than.

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