CS100A Lecture 15
Search in a Sorted Array
Example
Loop Pattern
Loop Invariant
Initial and Final Conditions
Initialization and Termination
Specify the Body
Refine the Body: Even length case
Refine the Body: Odd length case
Refine the Body
Conditional Expressions
Final Program
Asymptotic Complexity
Download presentation source