Hash table

Hash table preview
remixableManimCE2Ddata structuresloop

manim/hash_table.py

"""Hash table: eight buckets, keys routed by k mod 8, one of them colliding.

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/hash_table.py HashTable
    ASSET_MODE=motion $P -m manim -qh   -r 1600,1600 manim/hash_table.py HashTableLoop
"""

import numpy as np
from manim import (
    DOWN,
    LEFT,
    UP,
    Line,
    NumberPlane,
    Rectangle,

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