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
42tokyo-push_swap-data_structure
Search
love42
February 23, 2023
Programming
0
350
42tokyo-push_swap-data_structure
love42
February 23, 2023
Tweet
Share
More Decks by love42
See All by love42
42Tokyo-push_swap
love42
0
2.6k
[42tokyo]forest-green_MTG#5
love42
0
59
Other Decks in Programming
See All in Programming
関数型まつりレポート for JuliaTokai #22
antimon2
0
150
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
1
300
生成AIで日々のエラー調査を進めたい
yuyaabo
0
640
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
1.3k
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
250
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
160
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
CursorはMCPを使った方が良いぞ
taigakono
1
170
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
880
ASP.NETアプリケーションのモダナイズ インフラ編
tomokusaba
1
410
Go1.25からのGOMAXPROCS
kuro_kurorrr
1
800
Gleamという選択肢
comamoca
6
760
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Become a Pro
speakerdeck
PRO
28
5.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Done Done
chrislema
184
16k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
A Modern Web Designer's Workflow
chriscoyier
694
190k
GraphQLとの向き合い方2022年版
quramy
47
14k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.8k
Statistics for Hackers
jakevdp
799
220k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.3k
Transcript
PUSH_SWAP PUSH_SWAP
push_swap
push_swap
1. 2. 3.
None
None
None
None
( ) ...
None
LOOP
None
3 6 4 2 5 1 a[0] a[1] a[2] a[3]
a[4] a[5] stack A malloc ./push_swap 3 6 4 2 5 1
6 4 5 a[0] a[1] a[2] a[3] a[4] a[5] 3
2 1 b[0] b[1] b[2] b[3] b[4] b[5] stack A stack B malloc B
None
push / rotate
push 3 4 5 6 a[0] a[1] a[2] a[3] a[4]
a[5] 2 1 b[0] b[1] b[2] b[3] b[4] b[5] stack A stack B push stack A push stack B pa
push / rotate LOOP
None
A F NULL B C D E
3 b 1 NULL 6 c 4 d 2 e
5 f ./push_swap 3 6 4 2 5 1 a b c d e f malloc malloc malloc malloc malloc malloc t_list t_node head num next
None
push 1 NULL stack A stack B 3 c 6
NULL 4 e 2 f 5 b a b c d e head : a head : d f pa
push 1 NULL stack A stack B 3 c 6
NULL 4 e 2 a 5 b a b c d e f head : d head : f f
None
rotate next
rotate 1 d stack A stack A 3 c 6
d 4 e 2 NULL 5 b a b c d e head : a head : d f rra 1 NULL 3 c 6 d 4 e 5 b a b c e f 2 a d
rotate LOOP
None
None
None
NULL 1 6 NULL 2 3 4 5
NULL 3 b e 1 NULL a 6 c b
4 d c 2 e d 5 f ./push_swap 3 6 4 2 5 1 a b c d e f malloc malloc malloc malloc malloc malloc t_list t_node head tail num next prev
rotate NULL 3 c b 1 d e 6 f
a 4 e f 2 NULL c 5 b a b c d e f d 3 c b 1 NULL e 6 f a 4 e NULL 2 a c 5 b a b c d e f stack A stack A head : a tail : d head : d tail : f rra tail -> prev
LOOP
None
( ...) " "
None
None