Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/autopilot.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Nothing. The exam-stack block (since 2026-11-06, over #68's inline practice ques

Newest first. One line per run: date and run, what was done, PR link, merged or open.

- 2026-11-20 14:50 (run C): from the 2026-11-12 audit, the Data Structures union-find forest (110 px too wide at 390 px in its starting state of 8 singletons) now fits: single-node sets take a smaller gap, the minimum width applies from sm up, node labels are larger on phones (at least 15 px, nodes at least 24 px wide to tap), and the forest is centred. PR #110, open.
- 2026-11-17 14:50 (run C): from the 2026-11-12 audit, the Computer Organization `bits-and-bytes` unit ladder (124 px too wide at 390 px) now fits. Its captions now sit under their bars in a two-column grid at every width, which also fixes the desktop TB and PB captions wrapping unindented, and "2^0 = 1 bytes" now reads "1 byte". PR #99, open. Its CI check is red only because main is: The Exam Mind's round 7 (#97) renamed a heading that a bank question points at; fixed in PR #100.
- 2026-11-17 10:40 (run B): exam phase 4c, Computer Organization: +26 questions over all 9 taught lessons, numbers checked by script (500 GB shown as 465.7, G = 01000111, 2¹⁶ and 2¹² locations, the disk capacity 516,096,000 bytes, 4.2 ms average wait at 7,200 rpm). PR #96, open, stacked on #94.
- 2026-11-17 06:10 (run A): exam phase 4c, Microprocessors: +34 questions over all 11 taught lessons, every value checked by script (C8h + 64h flags, CS:IP and segment limits, effective address, MUL/DIV results, XOR case flip, LOOP sum, SP after push/pop, INT 21h vector at 84h). PR #94, open, stacked on #91.
Expand Down
11 changes: 7 additions & 4 deletions src/components/mdx/DataStructureVisualizers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -565,13 +565,16 @@ export function UnionFindLab() {
placed.push({ v, x, y: d, parent });
return x;
};
// a set of one needs less room than a tree, so the eight starting singletons fit a phone
let lastGap = 0.4;
roots.forEach((r) => {
lay(r, 0, null);
col += 0.4;
lastGap = kids(r).length ? 0.4 : 0.15;
col += lastGap;
});
const maxD = Math.max(...placed.map((p) => p.y));
const W = Math.max(300, col * 44 + 20);
const X = (x: number) => 26 + (x / Math.max(1, col - 0.4)) * (W - 52);
const X = (x: number) => 26 + (x / Math.max(1, col - lastGap - 1)) * (W - 52);
const Y = (y: number) => 24 + y * 54;
const pos = new Map(placed.map((p) => [p.v, p]));
return (
Expand All @@ -582,7 +585,7 @@ export function UnionFindLab() {
<button type="button" className={chip} onClick={() => { let t = ufStart(UF_N); for (const [a, b] of [[0, 1], [2, 3], [0, 2], [4, 5], [6, 7], [4, 6], [0, 4]] as const) t = ufUnion(t, a, b); setS({ ...t, note: "Seven unions: everything is one set. Click Find on 7 or 3 to see path compression flatten the tree." }); setPick(null); setPath([]); }}>join everything</button>
</div>
<div className="overflow-x-auto">
<svg viewBox={`0 0 ${W} ${maxD * 54 + 48}`} className="block mx-auto h-auto" style={{ width: "100%", maxWidth: W * 1.3, minWidth: Math.min(W, 520) * 0.8 }} role="img" aria-label="disjoint-set forest">
<svg viewBox={`0 0 ${W} ${maxD * 54 + 48}`} className="block mx-auto h-auto sm:min-w-[var(--uf-min)]" style={{ width: "100%", maxWidth: W * 1.3, "--uf-min": `${Math.min(W, 520) * 0.8}px` } as React.CSSProperties} role="img" aria-label="disjoint-set forest">
{placed.map((p) => {
if (p.parent === null) return null;
const q = pos.get(p.parent)!;
Expand All @@ -592,7 +595,7 @@ export function UnionFindLab() {
<g key={p.v} className="cursor-pointer" onClick={() => click(p.v)}>
<circle cx={X(p.x)} cy={Y(p.y)} r={17} className="fill-card" />
<circle cx={X(p.x)} cy={Y(p.y)} r={17} strokeWidth={2} className={`transition-colors ${p.v === pick ? "fill-neon/30 stroke-neon" : path.includes(p.v) ? "fill-mint/40 stroke-mint" : p.parent === null ? "fill-violet/25 stroke-violet" : "fill-card stroke-border"} hover:stroke-foreground`} />
<text x={X(p.x)} y={Y(p.y) + 4.5} textAnchor="middle" className="fill-foreground font-mono text-[13px] font-bold pointer-events-none">{p.v}</text>
<text x={X(p.x)} y={Y(p.y) + 4.5} textAnchor="middle" className="fill-foreground font-mono [font-size:16px] sm:[font-size:13px] font-bold pointer-events-none">{p.v}</text>
</g>
))}
</svg>
Expand Down
Loading