Skip to content

Conversation

@PratyushJoshi
Copy link
Contributor

In the leftmostSum, rightmostSum, and lastNodeSum methods, you're calculating the sums correctly, but the results are not being used or returned properly. You need to return the calculated sums from these methods.

The sameParent method is declared as an instance method, but it's used as if it's a static method in the comment. Depending on how you intend to use it, you should declare it as a static method or adjust its usage accordingly.

In the preOrderBST and bstFromPreorder methods, you should consider changing the parameter type to long[] to match the data type you're working with (i.e., long) in your TreeNode.

There is a missing import statement for BigInteger. You should add the following import statement at the beginning of your code:

In the leftmostSum, rightmostSum, and lastNodeSum methods, you're calculating the sums correctly, but the results are not being used or returned properly. You need to return the calculated sums from these methods.

The sameParent method is declared as an instance method, but it's used as if it's a static method in the comment. Depending on how you intend to use it, you should declare it as a static method or adjust its usage accordingly.

In the preOrderBST and bstFromPreorder methods, you should consider changing the parameter type to long[] to match the data type you're working with (i.e., long) in your TreeNode.

There is a missing import statement for BigInteger. You should add the following import statement at the beginning of your code:
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