Sorting Analysis
To understand sorting algorithms we need to identify certain different
parts and characteristics of each algorithm.
- OEB (one egg breakfast) metric
- Phases
- Worksteps
- Frequency
- Cost
- Possible asbtractions
Here is an example analysis for the bubble sort.
- OEB metric - comparison of two elements
- Phases - index calculation, swapping pass
- Worksteps
- Comparison - most frequent - constant cost
- Swapping values - frequent but not always - constant cost
- One pass - least frequent - cost proportional to number of elements to be sorted.
- Possible asbtractions - swapping, index calculation, a single pass.
Back to the Daily Record.
Back to the class web-page.