Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
77
面試面試面試,因為很重要所以要說三次!
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
95
[ACM-ICPC] Tree Isomorphism
kuoe0
1
220
Other Decks in Programming
See All in Programming
WebAssembly Unleashed: Powering Server-Side Applications
chrisft25
0
1.9k
Full stack testing :: basic to basic
up1
1
760
Arm移行タイムアタック
qnighy
0
390
物流システムにおけるリファクタリングとアーキテクチャの再構築 〜依存関係とモジュール分割の重要性〜
deeprain
1
240
14 Years of iOS: Lessons and Key Points
seyfoyun
0
370
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
260
CSC509 Lecture 13
javiergs
PRO
0
120
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
7
3.1k
PipeCDの歩き方
kuro_kurorrr
3
130
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Italy
prof18
0
120
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
3
350
TypeScript でバックもやるって実際どう? 実運用で困ったこと3選
yuichiro_serita
17
6.6k
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
133
8.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Facilitating Awesome Meetings
lara
50
6.1k
A Tale of Four Properties
chriscoyier
156
23k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Ruby is Unlike a Banana
tanoku
97
11k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
1
210
Designing the Hi-DPI Web
ddemaree
280
34k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
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