FIND-MINIMUMThe FIND-MINIMUM algorithm reflects on the state of present day computer technology:
1 if
2 then return NIL /* No minimum in an empty array. */
3
4
5 while
6 do if
7 then
8
9 return
| Value of | ||||
| 1 | 1 | 1 | 1 | 4 |
| 10 | 1000 | 100 | 10 | 4 |
| 100 | 1000000 | 10000 | 100 | 4 |
| 1000 | 1000000000 | 1000000 | 1000 | 4 |
| INSERTION-SORT( ) | Cost | Times |
| 1 for to | ||
| 2 do | ||
| 3 | ||
| 4 while and | ||
| 5 do | ||
| 6 | ||
| 7 |