Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Selection Sort
Search
KuoE0
March 04, 2013
Programming
1
1.7k
Selection Sort
KuoE0
March 04, 2013
Tweet
Share
More Decks by KuoE0
See All by KuoE0
Protocol handler in Gecko
kuoe0
0
78
面試面試面試,因為很重要所以要說三次!
kuoe0
2
210
應徵軟體工程師
kuoe0
0
150
面試心得分享
kuoe0
0
390
Windows 真的不好用...
kuoe0
0
260
Python @Wheel Lab
kuoe0
0
180
Introduction to VP8
kuoe0
0
200
Python @NCKU_CSIE
kuoe0
0
96
[ACM-ICPC] Tree Isomorphism
kuoe0
1
220
Other Decks in Programming
See All in Programming
return文におけるstd::moveについて
onihusube
1
980
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
710
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.6k
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
300
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
110
useSyncExternalStoreを使いまくる
ssssota
6
1k
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
770
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
181
21k
Navigating Team Friction
lara
183
15k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
The Language of Interfaces
destraynor
154
24k
Git: the NoSQL Database
bkeepers
PRO
427
64k
For a Future-Friendly Web
brad_frost
175
9.4k
Side Projects
sachag
452
42k
A better future with KSS
kneath
238
17k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
We Have a Design System, Now What?
morganepeng
51
7.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Why Our Code Smells
bkeepers
PRO
335
57k
Transcript
Selection Sort ֲࢸݢʢKuoE0ʣ
[email protected]
KuoE0.ch
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) http://creativecommons.org/licenses/by-sa/3.0/ Latest update: Mar
4, 2013
5 2 7 1 1 6 3 The original sequence.
1 2 3 4 5 6 7
1 2 3 4 5 6 7 5 2 7
1 1 6 3
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
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
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
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
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
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
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
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 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 7 1
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 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
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
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
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
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
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
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
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 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 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
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
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.
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
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
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
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
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 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 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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.
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
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
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.
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
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
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 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 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
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
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
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 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 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
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
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.
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
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
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
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
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
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.
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.
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
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
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.
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
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
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
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.
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.
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
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
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
End