Grid cell / memory cell Sweep cursor Binary search: lo–hi window Binary search: mid
⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.

Array Indexing Simulation

This simulator makes array indexing tangible by showing the same data two ways at once: a 2D grid on top, and the flat 1D memory block it actually lives in below. Toggling between row-major and column-major layout changes the formula that converts a (row, col) pair into a linear offset, and a sweep animation shows exactly which order each layout visits memory in — sequential and cache-friendly, or strided and expensive. Underneath, a binary search runs on that same linear array, with lo, mid and hi indices tracked live so the O(log n) halving process is visible step by step rather than abstract.