COEN 179 Lecture Notes - Lecture 10: Computational Complexity Theory, Binary Search Algorithm, Merge Sort
Document Summary
Coen 179 lecture 10 divide & conquer algorithms notes. Idea: express solutions to instance size n as a combination of solutions to instance size n / b for some b > 1. Template: divide instance to instances of size n / b. Recursively solve the sub instances combine the subsolutions es . 121 1 hi ] . de tj iffeoshi ) return false; M switch ( compare ( x , acm ) ) ){ Case o : return true ; case t. retumbsfac. mn . case - : return t. sc/7ceom-1dj hi gg. Binary search analysis ( ( n) = # of array element comparisons (a) = constant. Applying mt , a =l , b=3d=o n =2m. 1=23 and c- eln hgh) = -0 agn) e - 9 . Ms ( a ceo . if ceo hi ] ) e hi ) return; m= kothi ) 12 ; Merge ( aseo , m ) jj hi ] i.