Skip to content

redundant and duplicate lines fixed #4258

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

Merged
merged 2 commits into from
Jul 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.LinkedList;
import java.util.Queue;

/**
/*
* This entire class is used to build a Binary Tree data structure. There is the
* Node Class and the Tree Class, both explained below.
*/
Expand Down Expand Up @@ -164,13 +164,11 @@ else if (temp.left != null && temp.right != null) {
if (successor.right != null) {
successor.right.parent = successor.parent;
successor.parent.left = successor.right;
successor.right = temp.right;
successor.right.parent = successor;
} else {
successor.parent.left = null;
successor.right = temp.right;
successor.right.parent = successor;
}
successor.right = temp.right;
successor.right.parent = successor;
}

if (temp == root) {
Expand Down Expand Up @@ -304,7 +302,7 @@ public void postOrder(Node localRoot) {
*/
public void bfs(Node localRoot) {
// Create a queue for the order of the nodes
Queue<Node> queue = new LinkedList<Node>();
Queue<Node> queue = new LinkedList<>();

// If the give root is null, then we don't add to the queue
// and won't do anything
Expand Down