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.7k
[42tokyo]forest-green_MTG#5
love42
0
60
Other Decks in Programming
See All in Programming
CSC509 Lecture 07
javiergs
PRO
0
250
Devoxx BE - Local Development in the AI Era
kdubois
0
150
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
950
Ktorで簡単AIアプリケーション
tsukakei
0
110
実践Claude Code:20の失敗から学ぶAIペアプログラミング
takedatakashi
18
9k
Cursorハンズオン実践!
eltociear
2
1.2k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
320
EMこそClaude Codeでコード調査しよう
shibayu36
0
460
マイベストのシンプルなデータ基盤の話 - Googleスイートとのつき合い方 / mybest-simple-data-architecture-google-nized
snhryt
0
100
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
540
Amazon Verified Permissions実践入門 〜Cedar活用とAppSync導入事例/Practical Introduction to Amazon Verified Permissions
fossamagna
2
100
O Que É e Como Funciona o PHP-FPM?
marcelgsantos
0
210
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Making Projects Easy
brettharned
120
6.4k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Being A Developer After 40
akosma
91
590k
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
10
890
Context Engineering - Making Every Token Count
addyosmani
8
310
Mobile First: as difficult as doing things right
swwweet
225
10k
How to Think Like a Performance Engineer
csswizardry
27
2.1k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
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