Skip to content

feat(trees): expand from 1 to 87 algorithms with 5 new tracker variants - #34

Merged
reshinto merged 3 commits into
mainfrom
feat/trees-expand-algorithms
Apr 6, 2026
Merged

feat(trees): expand from 1 to 87 algorithms with 5 new tracker variants#34
reshinto merged 3 commits into
mainfrom
feat/trees-expand-algorithms

Conversation

@reshinto

@reshinto reshinto commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Expand trees category from 1 to 87 algorithms across 6 technique subcategories
  • Add 5 new tracker variants: BSTOperationTracker, TreePropertyTracker, TreeConstructionTracker, TreeManipulationTracker, AdvancedTreeTracker
  • Extend TreeNodeState (4→8 states), TreeVisualState (9 new fields), TreeNode (childrenIds for n-ary), 26 new StepTypes
  • Update TreeVisualizer for n-ary edge rendering, dual-tree support, and operation labels
  • Each algorithm with recursive AND iterative variants as separate directories
  • CI shards optimized: vitest 10→12, E2E 14→16

Algorithm Breakdown

Technique Count Highlights
traversal 13 inorder/preorder/postorder (recursive + iterative), level-order, zigzag, vertical, boundary, diagonal, morris
bst-operations 21 search, insert, delete, validation, kth-smallest, LCA, from-sorted-array, iterator, floor-ceil, range-sum, to-greater-tree, recover-swapped
properties 21 depth, diameter, balanced, symmetric, count-complete, path-sum, max-path-sum, left-leaves, root-to-leaf paths, tilt, cousins
construction 6 build from preorder+inorder, postorder+inorder, serialize-deserialize, level-order
manipulation 16 invert, flatten, right-side-view, same-tree, merge, subtree-of, LCA (general), delete-leaves, distribute-coins, flip-equivalent
advanced 10 AVL, red-black, segment tree, BIT, tree-to-DLL, pruning, n-ary, huffman, expression tree

Test plan

  • npm run lint — 0 errors
  • npm run format — clean
  • npm run typecheck — 0 errors
  • npm test — 910 files, 8020 tests passed
  • E2E trees spec — 87/87 passed
  • Full E2E suite — 777/777 passed, 0 regressions
  • Code review — 4 issues found and fixed (naming conflict, casing, dead code, duplicate method)

reshinto added 3 commits April 6, 2026 12:23
Add 86 new tree algorithms across 6 technique subcategories:
- traversal (12 new): inorder/preorder/postorder iterative, level-order,
  reverse-level-order, zigzag, vertical-order, boundary, diagonal, morris
- bst-operations (21 new): search, insert, delete, validation, kth-smallest,
  LCA, from-sorted-array, iterator, floor-ceil, range-sum, to-greater-tree,
  recover-swapped — each with recursive and iterative variants
- properties (21 new): max/min depth, diameter, balanced, symmetric,
  count-complete, path-sum, max-path-sum, left-leaves, root-to-leaf paths,
  tilt, cousins, root-to-leaf numbers — with iterative variants
- construction (6 new): build from preorder+inorder, postorder+inorder,
  serialize-deserialize, level-order — with iterative variants
- manipulation (16 new): invert, flatten, right-side-view, same-tree, merge,
  subtree-of, LCA (general), delete-leaves, distribute-coins, flip-equivalent
- advanced (10 new): AVL rotation, red-black insert, segment tree range
  sum/min, binary indexed tree, tree-to-DLL, pruning, n-ary traversal,
  huffman coding, expression tree evaluation

Infrastructure: extend TreeNodeState (4→8), TreeVisualState (9 new fields),
TreeNode (childrenIds for n-ary), 26 new StepTypes, TreeVisualizer updates
for n-ary edges, dual-tree rendering, and operation labels.

CI: increase vitest shards 10→12, E2E shards 14→16 for 453 total algorithms.
- Fix total algorithm count to 452 across README, catalog, testing
- Fix CI shard counts: vitest 8→12, E2E 12→16 in testing.md
- Fix algorithms-catalog.md category counts for searching (18),
  linked-lists (8), stacks-queues (28)
- Add TreeNodeState entry to glossary with all 8 states
- Add tree-specific debugging section to debugging.md
- Fix VisualState kind count 12→17, add 5 missing string kinds
- Add TreeNodeState→CSS token mapping to design-system.md
- Update architecture.md: trees annotation, input editors table,
  input editor file count 6→10
- Fix tracker subclass count 14→34 in glossary
- Fix session hooks count in claude-system.md and architecture.md
…te ID

Storybook resolves both matrices/diagonal-traversal and trees/diagonal-traversal
to the same story ID. Rename the tree variant to TreeDiagonalTraversalPipeline
with a unique title to prevent the collision.
@reshinto
reshinto merged commit 673819d into main Apr 6, 2026
36 checks passed
@reshinto
reshinto deleted the feat/trees-expand-algorithms branch April 6, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant