Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary Search Tree rotateRight() duplicates the nodes after rotation #2

Closed
ghost opened this issue May 15, 2014 · 1 comment · May be fixed by #162
Closed

Binary Search Tree rotateRight() duplicates the nodes after rotation #2

ghost opened this issue May 15, 2014 · 1 comment · May be fixed by #162

Comments

@ghost
Copy link

ghost commented May 15, 2014

    node.lesser = greater;
    if (greater != null)
        greater.parent = node;

greater node is already node.greater.
By above assignment, the greater is now assigned to both node.lesser and node.greater

@phishman3579
Copy link
Owner

@infiniteloop112 Actually, I see what you are saying but on line number 165 I am setting node.greater to NULL.

Node<T> greater = node.greater;
node.greater = null;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant