DSA
    beginner

    Arrays & Lists

    Array: [6 elements]

    [0]
    5
    [1]
    2
    [2]
    8
    [3]
    1
    [4]
    9
    [5]
    3

    Arrays calculate memory addresses directly: address = base + (index × element_size)

    The amber-highlighted neighbors show cache-line prefetching — a CPU typically loads 64 bytes at once, so nearby elements come along for free.

    Cheap or expensive?

    Sort

    Sort each dynamic-array operation by its cost.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    O(1)

    Drop items here

    O(n)

    Drop items here
    6 pieces left to place

    Test your knowledge

    20 questions
    Question 1 of 20
    Score: 0

    What is the time complexity of accessing an element in an array by index?

    Interview Questions

    Amazon
    Google
    Amazon
    Microsoft
    Apple
    Stripe
    Facebook
    Google
    Bloomberg
    Facebook
    Uber
    Bloomberg

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required