Skip to content

Refactor RootingTree with docs, final fields, and diagrams#1287

Merged
williamfiset merged 1 commit into
masterfrom
refactor-rooting-tree
Mar 13, 2026
Merged

Refactor RootingTree with docs, final fields, and diagrams#1287
williamfiset merged 1 commit into
masterfrom
refactor-rooting-tree

Conversation

@williamfiset

Copy link
Copy Markdown
Owner

Summary

  • Added clear class-level Javadoc with algorithm description and O(V+E) time / O(V) space complexity
  • Made id, parent, children fields final in TreeNode
  • Replaced LinkedList with ArrayList for better cache locality
  • Replaced wildcard import java.util.* with explicit imports
  • Added Javadoc to rootTree() and buildTree() methods
  • Added ASCII diagram of the undirected tree structure before rooting examples

Test plan

  • bazel build //src/main/java/.../treealgorithms:treealgorithms compiles successfully
  • Review output of main() matches expected layer comments

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@williamfiset williamfiset merged commit 90a66df into master Mar 13, 2026
2 checks passed
@williamfiset williamfiset deleted the refactor-rooting-tree branch March 13, 2026 00:24
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