ALGORITHMS Lecture Notes - Erik Demaine, Insertion Sort, Binary Search Algorithm

17 views6 pages
24 Oct 2022
School
Department
Professor

Document Summary

Instructors: erik demaine, jason ku, and justin solomon. Faster nd min/max (at rst and last index of array) Faster nds via binary search: o(log n) Order find prev(k) delete(k) find max() find next(k) Sorted array n n log n n log n n n n. Sorting: given a sorted array, we can leverage binary search to make an ef cient set data structure, input: (static) array a of n numbers, output: (static) array b which is a sorted permutation of a. Permutation: array with same elements in a different order. Sorted: b[i 1] b[i] for all i {1, . Correct by case analysis: try all possibilities (brute force) Solving recurrences: substitution: guess a solution, replace with representative function, recurrence holds true, recurrence tree: draw a tree representing the recursive calls and sum computation at nodes, master theorem: a formula to solve many recurrences (r03)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions