Browse Source

Paul: Hochladen des Zwischenstandes, RB-Tree funzt nicht, dafür die dot dateienerstellung

master
paul-anton.engel@informatik.hs-fulda.de 4 months ago
parent
commit
cc04a4088c
  1. 18
      Uebung08/Paul/IntComparable.java
  2. 22
      Uebung08/Paul/Main.java
  3. 144
      Uebung08/Paul/RBTree.java
  4. BIN
      bin/IntComparable.class
  5. BIN
      bin/Main.class
  6. BIN
      bin/RBTree$Node.class
  7. BIN
      bin/RBTree.class
  8. BIN
      output.svg
  9. 11
      output_step_0.dot
  10. 15
      output_step_1.dot
  11. 51
      output_step_10.dot
  12. 55
      output_step_11.dot
  13. 55
      output_step_12.dot
  14. 59
      output_step_13.dot
  15. 63
      output_step_14.dot
  16. 67
      output_step_15.dot
  17. 19
      output_step_2.dot
  18. 23
      output_step_3.dot
  19. 27
      output_step_4.dot
  20. 31
      output_step_5.dot
  21. 35
      output_step_6.dot
  22. 39
      output_step_7.dot
  23. 43
      output_step_8.dot
  24. 47
      output_step_9.dot

18
Uebung08/Paul/IntComparable.java

@ -0,0 +1,18 @@
class IntComparable implements Comparable<IntComparable> {
private int value;
IntComparable(int value) {
this.value = value;
}
@Override
public int compareTo(IntComparable other) {
return Integer.compare(this.value, other.value);
}
@Override
public String toString() {
// Verwenden Sie eine geeignete String-Darstellung, zum Beispiel den Wert selbst
return Integer.toString(value);
}
}

22
Uebung08/Paul/Main.java

@ -0,0 +1,22 @@
import java.util.Random;
public class Main {
public static void main(String[] args) {
RBTree<IntComparable> rbTree = new RBTree<>();
Random random = new Random();
for (int i = 0; i <= 15; i++) {
int randomValue = random.nextInt(100);
IntComparable key = new IntComparable(randomValue);
// Füge das Element ein und aktualisiere die DOT-Datei nach jedem Schritt
rbTree.printDOTAfterInsert("output_step_" + i + ".dot", key);
}
// Jetzt können Sie die DOT-Dateien in SVG umwandeln und anzeigen
// dot -Tsvg output_step_0.dot > output_step_0.svg
// dot -Tsvg output_step_1.dot > output_step_1.svg
// ...
}
}

144
Uebung08/Paul/RBTree.java

@ -0,0 +1,144 @@
// RBTree.java
import java.io.FileWriter;
import java.io.IOException;
class RBTree<T extends Comparable<T>> {
private static final boolean RED = true;
private static final boolean BLACK = false;
private static int step = 0;
private class Node {
T key;
Node left, right;
boolean color;
Node(T key, boolean color) {
this.key = key;
this.color = color;
}
}
private Node root;
public void insert(T key) {
root = insert(root, key);
root.color = BLACK; // Ensure the root is always black
}
private Node insert(Node root, T key) {
if (root == null) {
return new Node(key, RED); // New nodes are always red
}
int cmp = key.compareTo(root.key);
if (cmp < 0) {
root.left = insert(root.left, key);
} else if (cmp > 0) {
root.right = insert(root.right, key);
} else {
// Duplicate key, do not insert
return root;
}
// Fix any Red-Black tree violations
if (isRed(root.right) && !isRed(root.left)) {
root = rotateLeft(root);
}
if (isRed(root.left) && isRed(root.left.left)) {
root = rotateRight(root);
}
if (isRed(root.left) && isRed(root.right)) {
flipColors(root);
}
return root; // Return the updated root
}
private boolean isRed(Node node) {
if (node == null) {
return false;
}
return node.color == RED;
}
private Node rotateLeft(Node h) {
Node x = h.right;
h.right = x.left;
x.left = h;
x.color = h.color;
h.color = RED;
return x;
}
private Node rotateRight(Node h) {
Node x = h.left;
h.left = x.right;
x.right = h;
x.color = h.color;
h.color = RED;
return x;
}
private void flipColors(Node h) {
h.color = RED;
h.left.color = BLACK;
h.right.color = BLACK;
}
public void printDOTAfterInsert(String filename, T key) {
try (FileWriter writer = new FileWriter(filename)) {
writer.write("digraph G {\n");
writer.write("\tgraph [ratio=.48];\n");
writer.write("\tnode [style=filled, color=black, shape=circle, width=.6 \n");
writer.write("\t\tfontname=Helvetica, fontweight=bold, fontcolor=white, \n");
writer.write("\t\tfontsize=24, fixedsize=true];\n");
root = insert(root, key); // Füge das Element ein und aktualisiere den Baum
printDOTRecursive(root, writer);
writer.write("}\n");
} catch (IOException e) {
e.printStackTrace();
}
}
private void printDOTRecursive(Node node, FileWriter writer) throws IOException {
if (node != null) {
String keyString = node.key.toString().replaceAll("[^a-zA-Z0-9]", "_"); // Ersetze ungültige Zeichen
// Setze Farben basierend auf der Rot-Schwarz-Eigenschaft
String fillColor = (node.color == RED) ? "red" : "black";
String fontColor = (node.color == RED) ? "white" : "white"; // Ändern Sie dies, wenn Sie schwarzen Text auf rotem Hintergrund möchten
// Print current node mit Farbinformationen
writer.write("\t\"" + keyString + "\" [fillcolor=" + fillColor + ", fontcolor=" + fontColor + "];\n");
// Print left child
if (node.left != null) {
String leftKeyString = node.left.key.toString().replaceAll("[^a-zA-Z0-9]", "_");
writer.write("\t\"" + keyString + "\" -> \"" + leftKeyString + "\";\n");
printDOTRecursive(node.left, writer);
} else {
// Füge ein NIL-Blatt für leere linke Zweige hinzu
String leftNilKeyString = keyString + "_NIL_L";
writer.write("\t\"" + leftNilKeyString + "\" [shape=plaintext, label=\"NIL\", fontsize=16];\n");
writer.write("\t\"" + keyString + "\" -> \"" + leftNilKeyString + "\";\n");
}
// Print right child
if (node.right != null) {
String rightKeyString = node.right.key.toString().replaceAll("[^a-zA-Z0-9]", "_");
writer.write("\t\"" + keyString + "\" -> \"" + rightKeyString + "\";\n");
printDOTRecursive(node.right, writer);
} else {
// Füge ein NIL-Blatt für leere rechte Zweige hinzu
String rightNilKeyString = keyString + "_NIL_R";
writer.write("\t\"" + rightNilKeyString + "\" [shape=plaintext, label=\"NIL\", fontsize=16];\n");
writer.write("\t\"" + keyString + "\" -> \"" + rightNilKeyString + "\";\n");
}
}
}
}

BIN
bin/IntComparable.class

BIN
bin/Main.class

BIN
bin/RBTree$Node.class

BIN
bin/RBTree.class

BIN
output.svg

11
output_step_0.dot

@ -0,0 +1,11 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"56" -> "56_NIL_L";
"56_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"56" -> "56_NIL_R";
}

15
output_step_1.dot

@ -0,0 +1,15 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "33";
"33" [fillcolor=red, fontcolor=white];
"33_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_L";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"56" -> "56_NIL_R";
}

51
output_step_10.dot

@ -0,0 +1,51 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "25";
"25" [fillcolor=black, fontcolor=white];
"25" -> "15";
"15" [fillcolor=red, fontcolor=white];
"15" -> "11";
"11" [fillcolor=black, fontcolor=white];
"11_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_L";
"11_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_R";
"15" -> "19";
"19" [fillcolor=black, fontcolor=white];
"19_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"19" -> "19_NIL_L";
"19_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"19" -> "19_NIL_R";
"25" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33" -> "27";
"27" [fillcolor=red, fontcolor=white];
"27_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_L";
"27_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_R";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56" -> "69";
"69" [fillcolor=black, fontcolor=white];
"69" -> "63";
"63" [fillcolor=black, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
"69" -> "98";
"98" [fillcolor=black, fontcolor=white];
"98" -> "89";
"89" [fillcolor=red, fontcolor=white];
"89_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_L";
"89_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_R";
"98_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"98" -> "98_NIL_R";
}

55
output_step_11.dot

@ -0,0 +1,55 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "25";
"25" [fillcolor=black, fontcolor=white];
"25" -> "15";
"15" [fillcolor=red, fontcolor=white];
"15" -> "11";
"11" [fillcolor=black, fontcolor=white];
"11" -> "8";
"8" [fillcolor=red, fontcolor=white];
"8_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"8" -> "8_NIL_L";
"8_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"8" -> "8_NIL_R";
"11_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_R";
"15" -> "19";
"19" [fillcolor=black, fontcolor=white];
"19_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"19" -> "19_NIL_L";
"19_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"19" -> "19_NIL_R";
"25" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33" -> "27";
"27" [fillcolor=red, fontcolor=white];
"27_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_L";
"27_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_R";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56" -> "69";
"69" [fillcolor=black, fontcolor=white];
"69" -> "63";
"63" [fillcolor=black, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
"69" -> "98";
"98" [fillcolor=black, fontcolor=white];
"98" -> "89";
"89" [fillcolor=red, fontcolor=white];
"89_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_L";
"89_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_R";
"98_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"98" -> "98_NIL_R";
}

55
output_step_12.dot

@ -0,0 +1,55 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "25";
"25" [fillcolor=black, fontcolor=white];
"25" -> "15";
"15" [fillcolor=red, fontcolor=white];
"15" -> "11";
"11" [fillcolor=black, fontcolor=white];
"11" -> "8";
"8" [fillcolor=red, fontcolor=white];
"8_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"8" -> "8_NIL_L";
"8_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"8" -> "8_NIL_R";
"11_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_R";
"15" -> "19";
"19" [fillcolor=black, fontcolor=white];
"19_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"19" -> "19_NIL_L";
"19_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"19" -> "19_NIL_R";
"25" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33" -> "27";
"27" [fillcolor=red, fontcolor=white];
"27_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_L";
"27_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_R";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56" -> "69";
"69" [fillcolor=black, fontcolor=white];
"69" -> "63";
"63" [fillcolor=black, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
"69" -> "98";
"98" [fillcolor=black, fontcolor=white];
"98" -> "89";
"89" [fillcolor=red, fontcolor=white];
"89_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_L";
"89_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_R";
"98_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"98" -> "98_NIL_R";
}

59
output_step_13.dot

@ -0,0 +1,59 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "25";
"25" [fillcolor=black, fontcolor=white];
"25" -> "15";
"15" [fillcolor=red, fontcolor=white];
"15" -> "11";
"11" [fillcolor=black, fontcolor=white];
"11" -> "8";
"8" [fillcolor=red, fontcolor=white];
"8_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"8" -> "8_NIL_L";
"8_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"8" -> "8_NIL_R";
"11_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_R";
"15" -> "19";
"19" [fillcolor=black, fontcolor=white];
"19_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"19" -> "19_NIL_L";
"19_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"19" -> "19_NIL_R";
"25" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33" -> "27";
"27" [fillcolor=red, fontcolor=white];
"27_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_L";
"27_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_R";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56" -> "69";
"69" [fillcolor=black, fontcolor=white];
"69" -> "64";
"64" [fillcolor=black, fontcolor=white];
"64" -> "63";
"63" [fillcolor=red, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
"64_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"64" -> "64_NIL_R";
"69" -> "98";
"98" [fillcolor=black, fontcolor=white];
"98" -> "89";
"89" [fillcolor=red, fontcolor=white];
"89_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_L";
"89_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_R";
"98_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"98" -> "98_NIL_R";
}

63
output_step_14.dot

@ -0,0 +1,63 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "25";
"25" [fillcolor=black, fontcolor=white];
"25" -> "15";
"15" [fillcolor=red, fontcolor=white];
"15" -> "11";
"11" [fillcolor=black, fontcolor=white];
"11" -> "8";
"8" [fillcolor=red, fontcolor=white];
"8_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"8" -> "8_NIL_L";
"8_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"8" -> "8_NIL_R";
"11_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_R";
"15" -> "19";
"19" [fillcolor=black, fontcolor=white];
"19" -> "18";
"18" [fillcolor=red, fontcolor=white];
"18_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"18" -> "18_NIL_L";
"18_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"18" -> "18_NIL_R";
"19_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"19" -> "19_NIL_R";
"25" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33" -> "27";
"27" [fillcolor=red, fontcolor=white];
"27_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_L";
"27_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_R";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56" -> "69";
"69" [fillcolor=black, fontcolor=white];
"69" -> "64";
"64" [fillcolor=black, fontcolor=white];
"64" -> "63";
"63" [fillcolor=red, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
"64_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"64" -> "64_NIL_R";
"69" -> "98";
"98" [fillcolor=black, fontcolor=white];
"98" -> "89";
"89" [fillcolor=red, fontcolor=white];
"89_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_L";
"89_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_R";
"98_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"98" -> "98_NIL_R";
}

67
output_step_15.dot

@ -0,0 +1,67 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "25";
"25" [fillcolor=red, fontcolor=white];
"25" -> "15";
"15" [fillcolor=black, fontcolor=white];
"15" -> "11";
"11" [fillcolor=black, fontcolor=white];
"11" -> "8";
"8" [fillcolor=red, fontcolor=white];
"8_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"8" -> "8_NIL_L";
"8_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"8" -> "8_NIL_R";
"11_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_R";
"15" -> "19";
"19" [fillcolor=black, fontcolor=white];
"19" -> "18";
"18" [fillcolor=red, fontcolor=white];
"18_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"18" -> "18_NIL_L";
"18_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"18" -> "18_NIL_R";
"19_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"19" -> "19_NIL_R";
"25" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33" -> "27";
"27" [fillcolor=black, fontcolor=white];
"27_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_L";
"27_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_R";
"33" -> "49";
"49" [fillcolor=black, fontcolor=white];
"49_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"49" -> "49_NIL_L";
"49_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"49" -> "49_NIL_R";
"56" -> "69";
"69" [fillcolor=black, fontcolor=white];
"69" -> "64";
"64" [fillcolor=black, fontcolor=white];
"64" -> "63";
"63" [fillcolor=red, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
"64_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"64" -> "64_NIL_R";
"69" -> "98";
"98" [fillcolor=black, fontcolor=white];
"98" -> "89";
"89" [fillcolor=red, fontcolor=white];
"89_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_L";
"89_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_R";
"98_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"98" -> "98_NIL_R";
}

19
output_step_2.dot

@ -0,0 +1,19 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_L";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56" -> "63";
"63" [fillcolor=black, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
}

23
output_step_3.dot

@ -0,0 +1,23 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33" -> "25";
"25" [fillcolor=red, fontcolor=white];
"25_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"25" -> "25_NIL_L";
"25_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"25" -> "25_NIL_R";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56" -> "63";
"63" [fillcolor=black, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
}

27
output_step_4.dot

@ -0,0 +1,27 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "25";
"25" [fillcolor=red, fontcolor=white];
"25" -> "11";
"11" [fillcolor=black, fontcolor=white];
"11_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_L";
"11_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_R";
"25" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_L";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56" -> "63";
"63" [fillcolor=black, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
}

31
output_step_5.dot

@ -0,0 +1,31 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "25";
"25" [fillcolor=red, fontcolor=white];
"25" -> "11";
"11" [fillcolor=black, fontcolor=white];
"11_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_L";
"11_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_R";
"25" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_L";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56" -> "89";
"89" [fillcolor=black, fontcolor=white];
"89" -> "63";
"63" [fillcolor=red, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
"89_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_R";
}

35
output_step_6.dot

@ -0,0 +1,35 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "25";
"25" [fillcolor=red, fontcolor=white];
"25" -> "11";
"11" [fillcolor=black, fontcolor=white];
"11_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_L";
"11_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_R";
"25" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33" -> "27";
"27" [fillcolor=red, fontcolor=white];
"27_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_L";
"27_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_R";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56" -> "89";
"89" [fillcolor=black, fontcolor=white];
"89" -> "63";
"63" [fillcolor=red, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
"89_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_R";
}

39
output_step_7.dot

@ -0,0 +1,39 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "25";
"25" [fillcolor=black, fontcolor=white];
"25" -> "11";
"11" [fillcolor=black, fontcolor=white];
"11_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_L";
"11_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_R";
"25" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33" -> "27";
"27" [fillcolor=red, fontcolor=white];
"27_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_L";
"27_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_R";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56" -> "69";
"69" [fillcolor=black, fontcolor=white];
"69" -> "63";
"63" [fillcolor=black, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
"69" -> "89";
"89" [fillcolor=black, fontcolor=white];
"89_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_L";
"89_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_R";
}

43
output_step_8.dot

@ -0,0 +1,43 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "25";
"25" [fillcolor=black, fontcolor=white];
"25" -> "15";
"15" [fillcolor=black, fontcolor=white];
"15" -> "11";
"11" [fillcolor=red, fontcolor=white];
"11_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_L";
"11_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_R";
"15_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"15" -> "15_NIL_R";
"25" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33" -> "27";
"27" [fillcolor=red, fontcolor=white];
"27_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_L";
"27_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_R";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56" -> "69";
"69" [fillcolor=black, fontcolor=white];
"69" -> "63";
"63" [fillcolor=black, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
"69" -> "89";
"89" [fillcolor=black, fontcolor=white];
"89_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_L";
"89_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_R";
}

47
output_step_9.dot

@ -0,0 +1,47 @@
digraph G {
graph [ratio=.48];
node [style=filled, color=black, shape=circle, width=.6
fontname=Helvetica, fontweight=bold, fontcolor=white,
fontsize=24, fixedsize=true];
"56" [fillcolor=red, fontcolor=white];
"56" -> "25";
"25" [fillcolor=black, fontcolor=white];
"25" -> "15";
"15" [fillcolor=black, fontcolor=white];
"15" -> "11";
"11" [fillcolor=red, fontcolor=white];
"11_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_L";
"11_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"11" -> "11_NIL_R";
"15_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"15" -> "15_NIL_R";
"25" -> "33";
"33" [fillcolor=black, fontcolor=white];
"33" -> "27";
"27" [fillcolor=red, fontcolor=white];
"27_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_L";
"27_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"27" -> "27_NIL_R";
"33_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"33" -> "33_NIL_R";
"56" -> "69";
"69" [fillcolor=black, fontcolor=white];
"69" -> "63";
"63" [fillcolor=black, fontcolor=white];
"63_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_L";
"63_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"63" -> "63_NIL_R";
"69" -> "98";
"98" [fillcolor=black, fontcolor=white];
"98" -> "89";
"89" [fillcolor=red, fontcolor=white];
"89_NIL_L" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_L";
"89_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"89" -> "89_NIL_R";
"98_NIL_R" [shape=plaintext, label="NIL", fontsize=16];
"98" -> "98_NIL_R";
}
Loading…
Cancel
Save