Data Structures
First observe the behavior in Explore mode, then switch to Apply to test each operation with intent.
An array is a fundamental data structure that stores multiple elements of the same type in a contiguous block of memory. Each element is accessed by its index (position), starting from 0.
Contiguous Memory: All elements stored together in memory
Access: array[i] → O(1) time
Click an element to see how direct indexing works in O(1).
Selected Index
-
Selected Value
-
Ready|Waiting for an array operation
Time: Depends on operation|Space: O(1) auxiliary
Pseudocode
Arrays give direct index access, while inserts and deletes cost extra because elements shift.
Explore mode: click any box to inspect direct index access.
Index-based Access: O(1) time to access any element
Contiguous Memory: All elements stored together in memory
In Apply mode, test one operation and explain its complexity before running the next.
Before clicking run, predict the next index/pointer movement and then verify it.