Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Selection Sort

KuoE0
March 04, 2013

Selection Sort

KuoE0

March 04, 2013
Tweet

More Decks by KuoE0

Other Decks in Programming

Transcript

  1. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Set original sequence is unsorted part. 5 2 7 1 1 6 3
  2. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 4 5 6 7
  3. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7
  4. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5
  5. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5
  6. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5 2
  7. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5 2
  8. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5 2 7
  9. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5 2 7
  10. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5 2 7 1
  11. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5 2 7 1
  12. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5 2 7 1 1
  13. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5 2 7 1 1
  14. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5 2 7 1 1 6
  15. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5 2 7 1 1 6
  16. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5 2 7 1 1 6 3
  17. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Find minimum element in unsorted part. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 5 2 7 1 1 6 3
  18. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 1
  19. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Swap element back of sorted part and the minimum element. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 1 5 1
  20. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Swap element back of sorted part and the minimum element. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 1 5 1
  21. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 Swap element back of sorted part and the minimum element. 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 4 5 6 7 1 5 1 1 5
  22. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 5 6 7 5 1 1 5
  23. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 Find minimum element in unsorted part.
  24. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 Find minimum element in unsorted part. 2
  25. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 Find minimum element in unsorted part. 2
  26. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 Find minimum element in unsorted part. 2 7
  27. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 Find minimum element in unsorted part. 2 7
  28. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 Find minimum element in unsorted part. 2 7 5
  29. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 Find minimum element in unsorted part. 2 7 5
  30. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 Find minimum element in unsorted part. 2 7 5 1
  31. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 Find minimum element in unsorted part. 2 7 5 1
  32. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 Find minimum element in unsorted part. 2 7 5 1 6
  33. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 Find minimum element in unsorted part. 2 7 5 1 6
  34. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 Find minimum element in unsorted part. 2 7 5 1 6 3
  35. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 Find minimum element in unsorted part. 2 7 5 1 6 3
  36. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 1
  37. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 1 Swap element back of sorted part and the minimum element. 2 1
  38. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 1 Swap element back of sorted part and the minimum element. 2 1
  39. 1 2 3 4 5 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 Minimum: Position: 1 2 3 5 6 7 5 1 1 5 1 Swap element back of sorted part and the minimum element. 2 1 2 1
  40. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 4 5
  41. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: Find minimum element in unsorted part. 4 5
  42. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: Find minimum element in unsorted part. 7 4 5
  43. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: Find minimum element in unsorted part. 7 4 5
  44. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: Find minimum element in unsorted part. 7 5 4 5
  45. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: Find minimum element in unsorted part. 7 5 4 5
  46. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: Find minimum element in unsorted part. 7 5 4 2 5
  47. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: Find minimum element in unsorted part. 7 5 4 2 5
  48. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: Find minimum element in unsorted part. 6 7 5 4 2 5
  49. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: Find minimum element in unsorted part. 6 7 5 4 2 5
  50. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: Find minimum element in unsorted part. 6 3 7 5 4 2 5
  51. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: Find minimum element in unsorted part. 6 3 7 5 4 2 5
  52. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: 4 5 5 2
  53. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: 4 5 Swap element back of sorted part and the minimum element. 2 7 5 2
  54. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: 4 5 Swap element back of sorted part and the minimum element. 2 7 5 2
  55. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 1 2 3 6 7 5 1 1 5 2 1 2 1 Minimum: Position: 4 5 Swap element back of sorted part and the minimum element. 2 7 5 2 2 7
  56. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3
  57. Position: Minimum: 5 4 1 2 3 6 7 5

    2 7 1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 Find minimum element in unsorted part. 5 4 1 2 3 6 7 3
  58. Position: Minimum: 5 4 1 2 3 6 7 5

    2 7 1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 Find minimum element in unsorted part. 5 4 1 2 3 6 7 3 5
  59. Position: Minimum: 5 4 1 2 3 6 7 5

    2 7 1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 Find minimum element in unsorted part. 5 4 1 2 3 6 7 3 5
  60. Position: Minimum: 5 4 1 2 3 6 7 5

    2 7 1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 Find minimum element in unsorted part. 5 4 1 2 3 6 7 3 5 7
  61. Position: Minimum: 5 4 1 2 3 6 7 5

    2 7 1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 Find minimum element in unsorted part. 5 4 1 2 3 6 7 3 5 7
  62. Position: Minimum: 5 4 1 2 3 6 7 5

    2 7 1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 Find minimum element in unsorted part. 5 4 1 2 3 6 7 3 5 7 6
  63. Position: Minimum: 5 4 1 2 3 6 7 5

    2 7 1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 Find minimum element in unsorted part. 5 4 1 2 3 6 7 3 5 7 6
  64. Position: Minimum: 5 4 1 2 3 6 7 5

    2 7 1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 Find minimum element in unsorted part. 5 4 1 2 3 6 7 3 5 7 6 3
  65. Position: Minimum: 5 4 1 2 3 6 7 5

    2 7 1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 Find minimum element in unsorted part. 5 4 1 2 3 6 7 3 5 7 6 3
  66. Position: Minimum: 5 4 1 2 3 6 7 5

    2 7 1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 7 3
  67. Position: Minimum: 5 4 1 2 3 6 7 5

    2 7 1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 7 3 Swap element back of sorted part and the minimum element.
  68. Position: Minimum: 5 4 1 2 3 6 7 5

    2 7 1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 7 3 Swap element back of sorted part and the minimum element.
  69. Position: Minimum: 5 4 1 2 3 6 7 5

    2 7 1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 7 3 Swap element back of sorted part and the minimum element. 3 5
  70. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5
  71. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 Position: Minimum: Find minimum element in unsorted part.
  72. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 Position: Minimum: Find minimum element in unsorted part. 7
  73. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 Position: Minimum: Find minimum element in unsorted part. 7
  74. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 Position: Minimum: Find minimum element in unsorted part. 7 6
  75. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 Position: Minimum: Find minimum element in unsorted part. 7 6
  76. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 Position: Minimum: Find minimum element in unsorted part. 7 6 5
  77. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 Position: Minimum: Find minimum element in unsorted part. 7 6 5
  78. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 Position: Minimum: 7 5
  79. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 Position: Minimum: 7 5 7 5 Swap element back of sorted part and the minimum element.
  80. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 Position: Minimum: 7 5 7 5 Swap element back of sorted part and the minimum element.
  81. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 Position: Minimum: 7 5 7 5 Swap element back of sorted part and the minimum element. 5 7
  82. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7
  83. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 Position: Minimum: Find minimum element in unsorted part.
  84. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 Position: Minimum: Find minimum element in unsorted part. 6
  85. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 Position: Minimum: Find minimum element in unsorted part. 6
  86. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 Position: Minimum: Find minimum element in unsorted part. 6 7
  87. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 Position: Minimum: Find minimum element in unsorted part. 6 7
  88. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 Position: Minimum: 6 6
  89. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 6 Position: Minimum: 6 6 Swap element back of sorted part and the minimum element.
  90. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 6 Position: Minimum: 6 6 Swap element back of sorted part and the minimum element.
  91. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 6 Position: Minimum: 6 6 Swap element back of sorted part and the minimum element. 6
  92. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 6 6
  93. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 6 6 Position: Minimum: Find minimum element in unsorted part.
  94. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 6 6 Position: Minimum: Find minimum element in unsorted part. 7
  95. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 6 6 Position: Minimum: Find minimum element in unsorted part. 7
  96. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 6 6 Position: Minimum: 7
  97. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 6 6 Position: Minimum: 7 7 Swap element back of sorted part and the minimum element.
  98. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 6 6 Position: Minimum: 7 7 Swap element back of sorted part and the minimum element.
  99. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 7 3 5 3 3 5 7 5 5 7 6 6 Position: Minimum: 7 7 Swap element back of sorted part and the minimum element. 7
  100. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 3 5 3 3 5 7 5 5 7 6 6 7 7
  101. 5 4 1 2 3 6 7 5 2 7

    1 1 6 3 5 2 7 1 1 6 3 3 5 1 1 5 2 1 2 1 2 7 2 7 5 4 1 2 3 6 3 5 3 3 5 7 5 5 7 6 6 7 Sort complete. 7
  102. End