diff options
| author | mo khan <mo@mokhan.ca> | 2021-09-06 17:45:02 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2021-09-06 17:45:02 -0600 |
| commit | dfce7a44a8135ae1f17a4a7ca7145fafc7e027a4 (patch) | |
| tree | e35bce9cce17ee6751531ff159352142e996f01c /notes.md | |
| parent | dda094bc4289794d9294054aef3dd3c24adfe7b0 (diff) | |
add notes on efficiency
Diffstat (limited to 'notes.md')
| -rw-r--r-- | notes.md | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -67,3 +67,16 @@ real-world setting? a point in time to travel that doesn't align with orbital conditions might make it impossible for humans to survie the trip. * Driving directions from point A to B. + +# Efficiency + +Different algorithms devised to solve the same problem often differ dramatically +in their efficiency. + +* insertion sort takes n time to sort n items. +* merge sort takes time roughly equal to nlg(n) time to sort n items. + +By using an algorithm whose running time grows more slowly, even with a poor +compiler, computer B runes more than 17 times faster than computer A! + +As the problem size increases, so does the relative advantage of merge sort. |
