IMG_20190916_181617.jpg - Grand Grand Dith moo mal COSC 3P03 count the ofpp comparisons Always worrying about the worst cases Recursive"t n cefixed time

# IMG_20190916_181617.jpg - Grand Grand Dith moo mal COSC...

• 1

This preview shows page 1 out of 1 page.

#### You've reached the end of your free preview.

Want to read the whole page?

Unformatted text preview: Grand Grand - Dith moo mal COSC 3P03 count the # ofpp comparisons Always worrying about the worst cases ( Recursive ) &quot;t ( n ) cefixed time V at ( D ) + C - t ( B) = C t ( 10) = = (constant) t ( 1 ) = t ( 2 ) +C Assume nek &lt; - ( CI ) = C - Take u times to son = 1 = ( t ( B ) . c ) . c = ) + ( 1 ) + kc 2K - h = Logn = t (1 ) + dc = t( 1)the ( + ( 1 ) = c ) ( IL +1) C = ( ( ogn + 1 ) C O( ( ogn) P (a, D ) 3 =1 for 1 = 1 to n do s ( s * n D ( 2 ) How to do better? Divide and conquerer 28 - *4. x 4 do all once and multiply itself P ( u, D ) If n mod 3 = 0 . return ttext if 12= 0 return ! else if amod 3 - 1 rekum t * (at * 1 else ffy t E P ( a, L 3 1 ) ( recursive ) else if a mod 3 = 2 return tritt ty tig TRI MINH - TMG PRO GRAND CO., LTD...
View Full Document

• Winter '16

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern