Java icon indicating copy to clipboard operation
Java copied to clipboard

Java/DataStructures/Trees/BinaryTree.java has error with put method

Open Keenan-Ker51 opened this issue 8 years ago • 7 comments

The binary tree class seems to have an error on line 93, when trying to put more than one int into the tree it throws null pointer exception. I think the reason for this is that it calls the find function, using the value that you would want to add to the tree, so of course the find method will only return a null value, unless you happen to be adding the same value twice.

Keenan-Ker51 avatar Nov 13 '18 15:11 Keenan-Ker51

I think this can be solved by adding a null check for the parent before proceeding to the comparison. @Keenan-Ker51 Can you help with a PR?

varunu28 avatar Nov 13 '18 16:11 varunu28

I am interested in doing so, waiting for your allowance!

ales-blaze avatar Nov 13 '18 17:11 ales-blaze

@ales-blaze You don't need to wait. You can go ahead and open a PR

varunu28 avatar Nov 13 '18 17:11 varunu28

Wait, isn't there any way through which a particular person gets the authority to perform a particular task, To avoid work collisions.

ales-blaze avatar Nov 14 '18 07:11 ales-blaze

@ales-blaze You can just comment in the issue that you are working on it. This would avoid any conflicts.

varunu28 avatar Nov 14 '18 14:11 varunu28

Should this issue be closed? It seems like themanchangechina fixed it.

marcgood96 avatar Jan 29 '19 17:01 marcgood96

Yes. Closing it

varunu28 avatar Jan 29 '19 17:01 varunu28