Skip to content

Fix binary tree inorder and postorder traversals - #1643

Open
Eddiewalsh572 wants to merge 1 commit into
kunal-kushwaha:mainfrom
Eddiewalsh572:fix-binary-tree-traversals
Open

Fix binary tree inorder and postorder traversals#1643
Eddiewalsh572 wants to merge 1 commit into
kunal-kushwaha:mainfrom
Eddiewalsh572:fix-binary-tree-traversals

Conversation

@Eddiewalsh572

Copy link
Copy Markdown

Fixes #1633

This PR corrects the recursive calls in the BinaryTree traversal methods.

Changes:

  • inOrder() now calls inOrder(root)
  • inOrder(Node node) now recursively calls inOrder(...) for the left and right children
  • postOrder() now calls postOrder(root)
  • postOrder(Node node) now recursively calls postOrder(...) for the left and right children

Testing:

  • Compiled BinaryTree.java locally with javac

@mergify

mergify Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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.

Fix incorrect recursive calls in inOrder() and postOrder() in BinaryTree.java

2 participants