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...

This preview shows page 1 out of 1 page.

Image of page 1

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 ) "t ( n ) cefixed time V at ( D ) + C - t ( B) = C t ( 10) = = (constant) t ( 1 ) = t ( 2 ) +C Assume nek < - ( 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

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes