Stack and queue

Stack and queue preview
remixableManimCE2Ddata structuresloop

manim/stack_and_queue.py

"""Stack and queue: push and pop beside enqueue and dequeue, in step.

Render (the driver does this for every palette; these are for eyeballing):
    P=/opt/homebrew/opt/python@3.11/bin/python3.11
    ASSET_MODE=still  $P -m manim -s -t -r 1600,1600 manim/stack_and_queue.py StackAndQueue
    ASSET_MODE=motion $P -m manim -qh   -r 1600,1600 manim/stack_and_queue.py StackAndQueueLoop
"""

from manim import (
    DOWN,
    LEFT,
    Line,
    NumberPlane,
    Rectangle,
    Text,
    ValueTracker,

The full Manim source and the rendered video come with a plan.