Commit 0598a173 authored by Kair's avatar Kair

RedBlackTree

parent bee0dd95
......@@ -57,7 +57,7 @@ public class Main {
}
StringBuilder sb = new StringBuilder();
sb.append(root.getData() + root.getColor().toString());
sb.append(root.getData()).append(root.getColor().toString());
String pointerRight = "└──";
String pointerLeft = (root.getRight() != null) ? "├──" : "└──";
......@@ -74,7 +74,7 @@ public class Main {
sb.append("\n");
sb.append(padding);
sb.append(pointer);
sb.append(node.getData()+node.getColor().toString());
sb.append(node.getData()).append(node.getColor().toString());
StringBuilder paddingBuilder = new StringBuilder(padding);
if (hasRightSibling) {
......
......@@ -20,10 +20,6 @@ public class Node {
return color;
}
public void setData(int data) {
this.data = data;
}
public Node getLeft() {
return left;
}
......
public class RBTree {
private static final NodeRB EMPTY = new NodeRB(0);;
private static final NodeRB EMPTY = new NodeRB(0);
static {
EMPTY.leftNodeRB = EMPTY;
EMPTY.rightNodeRB = EMPTY;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment