Case Studies: Analyzing Standalone Functions

Steven J. Zeil

Old Dominion University, Dept. of Computer Science

Table of Contents

1. Ordered Insert
1.1. Analysis of orderedInsert
1.2. The loop
1.3. The main sequence
1.4. Finishing up
1.5. Special Case Behavior
2. Sequential Search
2.1. Analysis
2.2. Analysis (cont.)
2.3. Loop Condition
2.4. Loop Condition (cont.)
2.5. Marking the loop iterations
2.6. Loop Complexity
2.7. Loop Complexity
2.8. Marking the loop
2.9. Finishing up
2.10. Finishing up (cont.)
2.11. Ordered Sequencial Search
3. Binary Search
3.1. Starting the Analysis
3.2. Inner if
3.3. Outer if
3.4. Collapsed ifs
3.5. Loop body
3.6. Loop Body (cont.)
3.7. Loop condition
3.8. Loop repetitions
3.9. Loop complexity
3.10. Collapsing the loop
3.11. Function body sequence
3.12. Function body sequence (cont.)
3.13. The Final Answer

We'll illustrate the techniques we've learned with some of the array manipulation functions that we introduced earlier. In a later lesson, we'll look at analysis of class member functions.


In the Forum:

(no threads at this time)