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
Insertion Sort
Search
KuoE0
March 03, 2013
Programming
0
1.5k
Insertion Sort
KuoE0
March 03, 2013
Tweet
Share
More Decks by KuoE0
See All by KuoE0
Protocol handler in Gecko
kuoe0
0
96
面試面試面試,因為很重要所以要說三次!
kuoe0
2
240
應徵軟體工程師
kuoe0
0
160
面試心得分享
kuoe0
0
410
Windows 真的不好用...
kuoe0
0
280
Python @Wheel Lab
kuoe0
0
200
Introduction to VP8
kuoe0
0
240
Python @NCKU_CSIE
kuoe0
0
120
[ACM-ICPC] Tree Isomorphism
kuoe0
1
250
Other Decks in Programming
See All in Programming
Flutterで備える!Accessibility Nutrition Labels完全ガイド
yuukiw00w
0
160
Claude Code + Container Use と Cursor で作る ローカル並列開発環境のススメ / ccc local dev
kaelaela
10
5.7k
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
560
AIと”コードの評価関数”を共有する / Share the "code evaluation function" with AI
euglena1215
1
170
Modern Angular with Signals and Signal Store:New Rules for Your Architecture @enterJS Advanced Angular Day 2025
manfredsteyer
PRO
0
220
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
2.2k
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
270
ソフトウェア品質を数字で捉える技術。事業成長を支えるシステム品質の マネジメント
takuya542
2
13k
#QiitaBash MCPのセキュリティ
ryosukedtomita
1
1.4k
20250704_教育事業におけるアジャイルなデータ基盤構築
hanon52_
5
810
AIともっと楽するE2Eテスト
myohei
7
2.7k
ふつうの技術スタックでアート作品を作ってみる
akira888
1
890
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Testing 201, or: Great Expectations
jmmastey
43
7.6k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
510
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
54k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Code Reviewing Like a Champion
maltzj
524
40k
What's in a price? How to price your products and services
michaelherold
246
12k
The Cost Of JavaScript in 2023
addyosmani
51
8.5k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Transcript
Insertion 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
3, 2013
4 1 2 1 8 9 3 The original sequence.
4 1 2 1 8 9 3
4 1 2 1 8 9 3 Set 1st element
as sorted part. 4
4 1 2 1 8 9 3 4
4 1 2 1 8 9 3 Others are unsorted
part. 4 1 2 1 8 9 3
4 1 2 1 8 9 3 4 1 2
1 8 9 3
4 1 2 1 8 9 3 Enumerate elements in
unsorted part. 4 1 2 1 8 9 3 1
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 Copy the value to temporal variable.
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 4
4 1 2 1 8 9 3 Find the foremost
element great than the current element. 4 temp: 1 2 1 8 9 3 1 1 4
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 4 1
4 1 2 1 8 9 3 Insert the element.
4 temp: 1 2 1 8 9 3 1 4 1
4 1 2 1 8 9 3 Insert the element.
4 1 2 1 8 9 3 1 1 4
4 1 2 1 8 9 3 Insert the element.
4 1 2 1 8 9 3 1 1 1 4
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4
4 1 2 1 8 9 3 Enumerate next element.
4 1 2 1 8 9 3 1 1 1 4 2
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 2
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 2 Copy the value to temporal variable.
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 2 4
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 2 Find the foremost element great than the current element. 4
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 Insert the element. 2
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 Insert the element. 2
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 Insert the element. 2 2
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 Enumerate next element. 1
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 1
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 1 Copy the value to temporal variable.
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 1 4 2
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 1 Find the foremost element great than the current element. 4 2
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 1 Find the foremost element great than the current element. 4 2
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 Insert the element. 1
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 Insert the element. 1
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 Insert the element. 1 1
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 Enumerate next element. 8
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 8
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 Copy the value to temporal variable. 8
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 8 4
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 8 No element is greater than the current element in sorted part. 4
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 8
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 Put back. 8
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 Put back. 8
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 Put back. 8 8
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 Enumerate next element. 9
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 Copy the value to temporal variable.
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 No element is greater than the current element in sorted part.
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 Put back. 9
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 Put back. 9
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 Put back. 9 9
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 9
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 9 Enumerate next element. 3
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 9 3 3
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 9 3 Copy the value to temporal variable. 3
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 9 3 3 9 8 4
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 9 3 3 Find the foremost element great than the current element. 9 8 4
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 9 3 3 Find the foremost element great than the current element. 9 8 4
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 9 3 3 Find the foremost element great than the current element. 9 8 4
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 9 3 9 8 4 3
4 1 2 1 8 9 3 4 temp: 1
2 1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 9 3 9 8 4 Insert the element. 3
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 9 3 9 8 4 Insert the element. 3
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 9 3 9 8 4 Insert the element. 3 3
4 1 2 1 8 9 3 4 1 2
1 8 9 3 1 1 1 4 2 4 2 2 1 4 2 1 1 8 4 9 9 9 3 9 8 4 Sort completely! 3 3
End