02b-MoreOnAlgorithmAnalysis - CENG 213 Data Structures More...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
10/19/2010 1 CENG 213 Data Structures 1 More on Algorithm Analysis What is Important? ringbutton3 An array-based list retrieve operation is O(1), a linked- list-based list retrieve operation is O(n). ringbutton3 But insert and delete operations are much easier on a linked-list-based list implementation. barb4right When selecting the implementation of an Abstract Data Type (ADT), we have to consider how frequently particular ADT operations occur in a given application. ringbutton3 If the problem size is always small, we can probably ignore the algorithm’s efficiency. circle5 In this case, we should choose the simplest algorithm. 2
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
10/19/2010 2 What is Important? (cont.) ringbutton3 We have to weigh the trade-offs between an algorithm’s time requirement and its memory requirements. ringbutton3 We have to compare algorithms for both style and efficiency. circle5 The analysis should focus on gross differences in efficiency and not reward coding tricks that save small amount of time. circle5 That is, there is no need for coding tricks if the gain is not too much. circle5 Easily understandable program is also important. ringbutton3 Order-of-magnitude analysis focuses on large problems. 3 A Comparison of Growth-Rate Functions 4
Image of page 2
10/19/2010 3 A Comparison of Growth-Rate Functions (cont.) 5 Growth-Rate Functions O(1) Time requirement is constant , and it is independent of the problem’s size. O(log 2 n) Time requirement for a logarithmic algorithm increases slowly as the problem size increases.
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

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