Skip to content

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

Closed

Description

@Keenan-Ker51

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.

Activity

  1. varunu28 commented on Nov 13, 2018

    @varunu28
    Contributor

    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?

  2. ales-blaze commented on Nov 13, 2018

    @ales-blaze

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

  3. varunu28 commented on Nov 13, 2018

    @varunu28
    Contributor

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

  4. ales-blaze commented on Nov 14, 2018

    @ales-blaze

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

  5. varunu28 commented on Nov 14, 2018

    @varunu28
    Contributor

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

  6. marcgood96 commented on Jan 29, 2019

    @marcgood96

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

  7. varunu28 commented on Jan 29, 2019

    @varunu28
    Contributor

    Yes. Closing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions