02b-MoreOnAlgorithmAnalysis

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

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

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

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

View Full Document
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
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.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

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