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
77
面試面試面試,因為很重要所以要說三次!
kuoe0
2
210
應徵軟體工程師
kuoe0
0
150
面試心得分享
kuoe0
0
390
Windows 真的不好用...
kuoe0
0
250
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
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
330
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.5k
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
610
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
Outline View in SwiftUI
1024jp
1
330
Jakarta EE meets AI
ivargrimstad
0
610
C++でシェーダを書く
fadis
6
4.1k
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
136
6.6k
Teambox: Starting and Learning
jrom
133
8.8k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Designing Experiences People Love
moore
138
23k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
A Philosophy of Restraint
colly
203
16k
Producing Creativity
orderedlist
PRO
341
39k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
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