Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Snapshot Array
Bookmark
Input
Standard
Multiple Snaps
Sparse
Custom
length
=
3
,
operations
=
[set(0,5), snap(), set(0,6), get(0,0), set(1,10), snap(), get(0,1), get(1,1)]
Snapshot Array
snapCount = 0
[0]
(0, 0)
[1]
(0, 0)
[2]
(0, 0)
History: (snap_id, value)
algo
master
.
io
Step:
Start: Initialize SnapshotArray of length 3. Each index starts with history [(0, 0)]. snapCount = 0.
0 / 35
Input
Standard
Multiple Snaps
Sparse
Custom
length
=
3
,
operations
=
[set(0,5), snap(), set(0,6), get(0,0), set(1,10), snap(), get(0,1), get(1,1)]
0 / 35
Snapshot Array
snapCount = 0
[0]
(0, 0)
[1]
(0, 0)
[2]
(0, 0)
History: (snap_id, value)
algo
master
.
io
Step:
Start: Initialize SnapshotArray of length 3. Each index starts with history [(0, 0)]. snapCount = 0.