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
81
面試面試面試,因為很重要所以要說三次!
kuoe0
2
220
應徵軟體工程師
kuoe0
0
150
面試心得分享
kuoe0
0
400
Windows 真的不好用...
kuoe0
0
260
Python @Wheel Lab
kuoe0
0
190
Introduction to VP8
kuoe0
0
210
Python @NCKU_CSIE
kuoe0
0
100
[ACM-ICPC] Tree Isomorphism
kuoe0
1
230
Other Decks in Programming
See All in Programming
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
590
SRE、開発、QAが協業して挑んだリリースプロセス改革@SRE Kaigi 2025
nealle
1
2.8k
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
970
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
190
AWS re:Invent 2024個人的まとめ
satoshi256kbyte
0
140
ErdMap: Thinking about a map for Rails applications
makicamel
1
840
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
440
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
330
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
9
1k
ecspresso, ecschedule, lambroll を PipeCDプラグインとして動かしてみた (プロトタイプ) / Running ecspresso, ecschedule, and lambroll as PipeCD Plugins (prototype)
tkikuc
2
2.1k
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1.1k
自分ひとりから始められる生産性向上の取り組み #でぃーぷらすオオサカ
irof
8
2k
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Designing for humans not robots
tammielis
250
25k
GitHub's CSS Performance
jonrohan
1030
460k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
It's Worth the Effort
3n
184
28k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
30
2.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
113
50k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
52k
The Cult of Friendly URLs
andyhume
78
6.2k
Unsuck your backbone
ammeep
669
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