Skip to content

feat(data-structures): add binary tree reconstruction from preorder + inorder#592

Merged
0xDevNinja merged 1 commit intomainfrom
feat/data-structures/build-tree-pre-in
May 7, 2026
Merged

feat(data-structures): add binary tree reconstruction from preorder + inorder#592
0xDevNinja merged 1 commit intomainfrom
feat/data-structures/build-tree-pre-in

Conversation

@0xDevNinja
Copy link
Copy Markdown
Owner

Summary

Reconstructs a binary tree from preorder and inorder traversals via HashMap lookup. O(n) overall.

Closes #379.

Test plan

  • Empty / single / classic example
  • Mismatched and inconsistent inputs return None
  • cargo fmt --check, cargo clippy -D warnings, cargo test pass

@0xDevNinja 0xDevNinja force-pushed the feat/data-structures/build-tree-pre-in branch from a808b76 to a8b9808 Compare May 7, 2026 10:20
@0xDevNinja 0xDevNinja merged commit c1fb2d6 into main May 7, 2026
@0xDevNinja 0xDevNinja deleted the feat/data-structures/build-tree-pre-in branch May 7, 2026 10:20
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.

Add binary tree reconstruction from preorder + inorder

1 participant