|
|
||
| 1. Figure2.10 |
|
|
|
||
|
|
||
| 2. |
|
|
|
||
|
|
||
| 3. Figure2.11 |
|
|
|
||
|
|
||
| 5. Analysis of Algorithms |
|
|
|
||
|
|
||
| 6. Figure 3.6 |
|
|
|
||
|
|
||
| 7. Figure 3.7 |
|
|
|
||
|
|
||
| 8. Figure 3.8 |
|
|
|
||
|
|
||
| 9. Order of magnitude |
|
|
|
||
|
|
||
| 10. Figure 3.10 |
|
|
|
||
|
|
||
| 11. Figure 3.11 |
|
|
|
||
|
|
||
| 12. Comparison |
|
|
|
||
|
|
||||||||||||||||||||||||||
| 13. Comparison 2 |
|
|||||||||||||||||||||||||
|
||||||||||||||||||||||||||
|
|
||
| 14. Comparison 3 |
|
|
|
||
|
|
||
| 15. Figure 3.13 |
|
|
|
||
|
|
||
| 16. Selection Sort |
|
|
|
||
|
|
||
| 17. Selection Sort Algorithm |
|
|
|
||
|
|
||||||||||||||||||
| 18. Sort Example |
|
|||||||||||||||||
|
||||||||||||||||||
|
|
||
| 19. Explanation of example |
|
|
|
||
|
|
||
| 20. Explanation of example 2 |
|
|
|
||
|
|
||
| 21. Explanation of example 3 |
|
|
|
||
|
|
||
| 22. Explanation of example 4 |
|
|
|
||
|
|
||
| 23. Selection Sort Analysis |
|
|
|
||
|
|
||
| 24. Binary Search algorithm |
|
|
|
||
|
|
||
| 25. Binary Search Algorithm (list must be sorted) |
|
|
|
||
|
|
||
| 26. Binary Search Algorithm (list must be sorted) 2 |
|
|
|
||
|
|
||
| 27. Binary Search Algorithm (list must be sorted) 3 |
|
|
|
||
|
|
||
| 28. Figure 3.20 |
|
|
|
||
|
|
||
| 29. Figure 3.21 |
|
|
|
||
|
|
||
| 30. Figure 3.22 |
|
|
|
||
|
|
||
| 31. Figure 3.23 |
|
|
|
||
|
|
||
| 32. Orders of magnitude |
|
|
|
||
|
|
||
| 33. Brute force algorithm |
|
|
|
||
|
|
||
| 34. Figure 3.24 |
|
|
|
||
|
|
||
| 35. Figure 3.25 |
|
|
|
||
|
|
||
| 36. Explanation |
|
|
|
||
|
|
||
| 37. Figure 3.26(a) |
|
|
|
||
|
|
||
| 38. Figure 3.27 |
|
|
|
||
|
|
||
| 39. Orders of Magnitude - 2 |
|
|
|
||
| n | Pc | Cray |
|---|---|---|
| 750 | 0.00001 sec | 0.00000084 sec |
| 7,500 | 0.0001 sec | 0.000084 sec |
| 75,000 | 0.001 sec | 0.0084 sec |
| 750,000 | 0.01 sec | 0.84 sec |
| 7,500,000 | 0.1 sec | 84 sec |
| 75,000,000 | 1 sec | 8400 sec = 2.3 hr |
| 750,000,000 | 10sec | 840,000 sec = 9.7 days |
output input
2 3 5 7 8 <--- 5 7 2 8 3
| Unsorted List | Sorted List |
|---|---|
| 5 7 2 8 3 | |
| 5 7 2 8 3 | |
| 5 7 2 3 | 8 |
| 5 2 3 | 7 8 |
| 2 3 | 5 7 8 |
| 2 | 3 5 7 8 |
| 2 3 5 7 8 |