diff --git a/Uebung08/Paul/Main.java b/Uebung08/Paul/Main.java index c5b0417..ff22be3 100644 --- a/Uebung08/Paul/Main.java +++ b/Uebung08/Paul/Main.java @@ -1,12 +1,22 @@ -import java.util.Random; +import java.util.*; public class Main { public static void main(String[] args) { - RBTree rbTree = new RBTree<>(); + Random random = new Random(); + RBTree rbTree = new RBTree<>(); + ArrayList numbers = new ArrayList<>(); + + // ein eingebauter Mechanismus, der sicherstellt, dass eine Zahl nicht 2-mal vorkommt, sonst würde der Baum nicht funktionieren + // Füllen der Liste mit Zahlen + for (int j = 1; j <= 100; j++) { + numbers.add(j); + } + //Collections.shuffle(numbers); // Liste mischen + + for (int i = 0; i < 15; i++) { + int randomValue = numbers.get(i); - 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 @@ -18,5 +28,4 @@ public class Main { // dot -Tsvg output_step_1.dot > output_step_1.svg // ... } -} - +} diff --git a/Uebung08/Paul/RBTree.java b/Uebung08/Paul/RBTree.java index 47b84f0..039b24a 100644 --- a/Uebung08/Paul/RBTree.java +++ b/Uebung08/Paul/RBTree.java @@ -11,7 +11,7 @@ class RBTree> { private class Node { T key; - Node left, right; + Node left, right, parent; // Elternknoten hinzugefügt boolean color; Node(T key, boolean color) { @@ -22,38 +22,142 @@ class RBTree> { private Node root; + private Node getUncle(Node parent) { + Node grandparent = parent.parent; + + if (grandparent.left == parent) { + return grandparent.right; // right is the uncle + + } else if (grandparent.right == parent) { + return grandparent.left; // left is the uncle + + } else { + throw new IllegalStateException("Parent is not a child of its grandparent"); + } + } + public void insert(T key) { - root = insert(root, key); + root = insert(root, null, key); // Parent für die Wurzel ist null 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 - } + private Node insert(Node root, Node parent, T key) { + Node node = root; + // Node parent = null; - 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); + // Traverse the tree to the left or right depending on the key + while (node != null) { + parent = node; + if (key.compareTo(node.key) < 0) { + node = node.left; + } else if (key.compareTo(node.key) > 0) { + node = node.right; + } else { + throw new IllegalArgumentException("BST already contains a node with key " + key); + } + } + // Insert new node + Node newNode = new Node(key, RED); + if (parent == null) { + root = newNode; + } else if (key.compareTo(parent.key) < 0) { + parent.left = newNode; } else { - // Duplicate key, do not insert - return root; + parent.right = newNode; + } + newNode.parent = parent; + fixColorafterInsert(newNode); + return newNode; + } + + /* + * 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); + * } + */ + + private void fixColorafterInsert(Node node) { + Node parent = node.parent; + + // Case 1: no root, add node as new root, root is always black + if (parent == null) { + node.color = false; + return; } - // Fix any Red-Black tree violations - if (isRed(root.right) && !isRed(root.left)) { - root = rotateLeft(root); + // Parent is black --> nothing to do + if (parent.color == false) { // Abbildung S.312, aber beide Knoten sind schon schwarz gefärbt + return; } - if (isRed(root.left) && isRed(root.left.left)) { - root = rotateRight(root); + + // From here on, parent(vater) is red + Node grandparent = parent.parent; + + Node uncle = getUncle(parent); // Get the uncle (maybe nil, in which case its color is BLACK) + + // Case 3 (parent uncle red, Abbildung S.313, 314): recolor parent, grandparent + // and uncle + if (uncle != null && uncle.color == true) { + parent.color = false; + uncle.color = false; + grandparent.color = true; + + // Call recursively for grandparent, which is now red. fix recursively + fixColorafterInsert(grandparent); } - if (isRed(root.left) && isRed(root.right)) { - flipColors(root); + + // Parent is left child of grandparent + // Case 4a: Uncle is black(nil is default black) and node is left --> right + // "inner child" of its grandparent + else if (parent == grandparent.left) { + + Node newParent; + + if (node == parent.right) { + newParent = rotateLeft(parent); + parent = newParent; + + // Let "parent" point to the new root node of the rotated sub-tree. + // It will be recolored in the next step, which we're going to fall-through to. + // parent = node; + } + + // Case 5a: Uncle is black and node is left->left "outer child" of its + // grandparent + rotateRight(grandparent); + + // Recolor original parent and grandparent + parent.color = false; + grandparent.color = true; } - return root; // Return the updated root + // Parent is right child of grandparent + else if (parent == grandparent.right) { + // Case 4b: Uncle is black and node is right->left "inner child" of its + // grandparent + if (node == parent.left) { + rotateRight(parent); + + // Let "parent" point to the new root node of the rotated sub-tree. + // It will be recolored in the next step, which we're going to fall-through to. + parent = node; + } + + // Case 5b: Uncle is black and node is right->right "outer child" of its + // grandparent + rotateLeft(grandparent); + + // Recolor original parent and grandparent + parent.color = false; + grandparent.color = true; + } } private boolean isRed(Node node) { @@ -63,39 +167,107 @@ class RBTree> { 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 rotateLeft(Node node) { + Node rightChild = node.right; + Node parent = node.parent; + + node.right = rightChild.left; + if (rightChild.left != null) { + rightChild.left.parent = node; + } + + rightChild.left = node; + node.parent = rightChild; + + rightChild.parent = parent; + if (parent == null) { + root = rightChild; + } else if (node == parent.left) { + parent.left = rightChild; + } else if (node == parent.right) { + parent.right = rightChild; + } else { + throw new IllegalStateException("Node is not a child of its parent"); + } + + if (rightChild != null) { + rightChild.parent = parent; + } + + RootBlack(); + + return rightChild; } - 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 Node rotateRight(Node node) { + Node leftChild = node.left; + Node parent = node.parent; + + node.left = leftChild.right; + if (leftChild.right != null) { + leftChild.right.parent = node; + } + + leftChild.right = node; + node.parent = leftChild; + + leftChild.parent = parent; + if (parent == null) { + root = leftChild; + } else if (node == parent.left) { + parent.left = leftChild; + } else if (node == parent.right) { + parent.right = leftChild; + } else { + throw new IllegalStateException("Node is not a child of its parent"); + } + + if (leftChild != null) { + leftChild.parent = parent; + } + + RootBlack(); + + return leftChild; } - private void flipColors(Node h) { - h.color = RED; - h.left.color = BLACK; - h.right.color = BLACK; + private void flipColors(Node node) { + node.color = !node.color; + node.left.color = !node.left.color; + node.right.color = !node.right.color; } - public void printDOTAfterInsert(String filename, T key) { + private void RootBlack() { + root.color = BLACK; + } + + /* + * public void printDOTAfterInsert(String filename, T key) { + * try (FileWriter writer = new FileWriter(filename)) { + * writer.write("digraph G {\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, null, key); // Füge das Element ein und aktualisiere den + * Baum + * printDOTRecursive(root, writer); + * + * writer.write("}\n"); + * } catch (IOException e) { + * e.printStackTrace(); + * } + * } + */ + + 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("\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 + // Hier wird der gesamte Baum gezeichnet, nicht nur der neu eingefügte Schlüssel printDOTRecursive(root, writer); writer.write("}\n"); @@ -103,25 +275,27 @@ class RBTree> { 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 keyString = node.key.toString().replaceAll("[^a-zA-Z0-9]", "_"); 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 + String fontColor = (node.color == RED) ? "white" : "white"; - // Print current node mit Farbinformationen writer.write("\t\"" + keyString + "\" [fillcolor=" + fillColor + ", fontcolor=" + fontColor + "];\n"); + // Print parent link + if (node.parent != null) { + String parentKeyString = node.parent.key.toString().replaceAll("[^a-zA-Z0-9]", "_"); + writer.write("\t\"" + parentKeyString + "\" -> \"" + keyString + "\" [style=dotted];\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"); @@ -133,12 +307,69 @@ class RBTree> { 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"); } } - } -} + } + + + /*public void printDOTAfterInsert(String filename, T key) { + try (FileWriter writer = new FileWriter(filename)) { + writer.write("digraph G {\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"); + + // Hier wird der gesamte Baum gezeichnet, nicht nur der neu eingefügte Schlüssel + 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]", "_"); + String fillColor = (node.color == RED) ? "red" : "black"; + String fontColor = (node.color == RED) ? "white" : "white"; + writer.write("\t\"" + keyString + "\" [fillcolor=" + fillColor + ", fontcolor=" + fontColor + "];\n"); + + /* + * Print parent link + * if (node.parent != null) { + * String parentKeyString = + * node.parent.key.toString().replaceAll("[^a-zA-Z0-9]", "_"); + * writer.write("\t\"" + parentKeyString + "\" -> \"" + keyString + + * "\" [style=dotted];\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 { + 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 { + String rightNilKeyString = keyString + "_NIL_R"; + writer.write("\t\"" + rightNilKeyString + "\" [shape=plaintext, label=\"NIL\", fontsize=16];\n"); + writer.write("\t\"" + keyString + "\" -> \"" + rightNilKeyString + "\";\n"); + } + } + */ +} \ No newline at end of file diff --git a/bin/Main.class b/bin/Main.class index 52d53e6..5d5b42c 100644 Binary files a/bin/Main.class and b/bin/Main.class differ diff --git a/bin/RBTree$Node.class b/bin/RBTree$Node.class index 64a9b55..b0a8196 100644 Binary files a/bin/RBTree$Node.class and b/bin/RBTree$Node.class differ diff --git a/bin/RBTree.class b/bin/RBTree.class index 19dd46e..914834f 100644 Binary files a/bin/RBTree.class and b/bin/RBTree.class differ diff --git a/output.svg b/output.svg index f45c4ff..a6faae9 100644 Binary files a/output.svg and b/output.svg differ diff --git a/output_step_0.dot b/output_step_0.dot index 2ffc6d5..574030d 100644 --- a/output_step_0.dot +++ b/output_step_0.dot @@ -1,11 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_1.dot b/output_step_1.dot index 45d7147..574030d 100644 --- a/output_step_1.dot +++ b/output_step_1.dot @@ -1,15 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_10.dot b/output_step_10.dot index 0f81282..574030d 100644 --- a/output_step_10.dot +++ b/output_step_10.dot @@ -1,51 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_11.dot b/output_step_11.dot index df8becb..574030d 100644 --- a/output_step_11.dot +++ b/output_step_11.dot @@ -1,55 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_12.dot b/output_step_12.dot index df8becb..574030d 100644 --- a/output_step_12.dot +++ b/output_step_12.dot @@ -1,55 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_13.dot b/output_step_13.dot index 488a727..574030d 100644 --- a/output_step_13.dot +++ b/output_step_13.dot @@ -1,59 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_14.dot b/output_step_14.dot index 52b6447..574030d 100644 --- a/output_step_14.dot +++ b/output_step_14.dot @@ -1,63 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_15.dot b/output_step_15.dot index 9b639e1..fea6424 100644 --- a/output_step_15.dot +++ b/output_step_15.dot @@ -1,67 +1,58 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; + "75" [fillcolor=black, fontcolor=white]; + "75" -> "73"; + "73" [fillcolor=red, fontcolor=white]; + "73" -> "51"; + "51" [fillcolor=black, fontcolor=white]; + "51" -> "39"; + "39" [fillcolor=black, fontcolor=white]; + "39" -> "38"; + "38" [fillcolor=red, fontcolor=white]; + "38" -> "34"; + "34" [fillcolor=black, fontcolor=white]; + "34" -> "28"; + "28" [fillcolor=black, fontcolor=white]; + "28" -> "13"; + "13" [fillcolor=red, fontcolor=white]; + "13_NIL_L" [shape=plaintext, label="NIL", fontsize=16]; + "13" -> "13_NIL_L"; + "13_NIL_R" [shape=plaintext, label="NIL", fontsize=16]; + "13" -> "13_NIL_R"; + "28_NIL_R" [shape=plaintext, label="NIL", fontsize=16]; + "28" -> "28_NIL_R"; + "34" -> "37"; + "37" [fillcolor=black, fontcolor=white]; + "37_NIL_L" [shape=plaintext, label="NIL", fontsize=16]; + "37" -> "37_NIL_L"; + "37_NIL_R" [shape=plaintext, label="NIL", fontsize=16]; + "37" -> "37_NIL_R"; + "38_NIL_R" [shape=plaintext, label="NIL", fontsize=16]; + "38" -> "38_NIL_R"; + "39_NIL_R" [shape=plaintext, label="NIL", fontsize=16]; + "39" -> "39_NIL_R"; + "51_NIL_R" [shape=plaintext, label="NIL", fontsize=16]; + "51" -> "51_NIL_R"; + "73_NIL_R" [shape=plaintext, label="NIL", fontsize=16]; + "73" -> "73_NIL_R"; + "75" -> "77"; + "77" [fillcolor=black, fontcolor=white]; + "77_NIL_L" [shape=plaintext, label="NIL", fontsize=16]; + "77" -> "77_NIL_L"; + "77" -> "80"; + "80" [fillcolor=black, fontcolor=white]; + "80_NIL_L" [shape=plaintext, label="NIL", fontsize=16]; + "80" -> "80_NIL_L"; + "80" -> "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" -> "81"; + "81" [fillcolor=black, fontcolor=white]; + "81_NIL_L" [shape=plaintext, label="NIL", fontsize=16]; + "81" -> "81_NIL_L"; + "81_NIL_R" [shape=plaintext, label="NIL", fontsize=16]; + "81" -> "81_NIL_R"; "98_NIL_R" [shape=plaintext, label="NIL", fontsize=16]; "98" -> "98_NIL_R"; } diff --git a/output_step_2.dot b/output_step_2.dot index 91e649e..574030d 100644 --- a/output_step_2.dot +++ b/output_step_2.dot @@ -1,19 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_3.dot b/output_step_3.dot index 96f7471..574030d 100644 --- a/output_step_3.dot +++ b/output_step_3.dot @@ -1,23 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_4.dot b/output_step_4.dot index 8b0be62..574030d 100644 --- a/output_step_4.dot +++ b/output_step_4.dot @@ -1,27 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_5.dot b/output_step_5.dot index 6227992..574030d 100644 --- a/output_step_5.dot +++ b/output_step_5.dot @@ -1,31 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_6.dot b/output_step_6.dot index ec102d9..574030d 100644 --- a/output_step_6.dot +++ b/output_step_6.dot @@ -1,35 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_7.dot b/output_step_7.dot index d0d7112..574030d 100644 --- a/output_step_7.dot +++ b/output_step_7.dot @@ -1,39 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_8.dot b/output_step_8.dot index 9b7826f..574030d 100644 --- a/output_step_8.dot +++ b/output_step_8.dot @@ -1,43 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; } diff --git a/output_step_9.dot b/output_step_9.dot index a20f5e0..574030d 100644 --- a/output_step_9.dot +++ b/output_step_9.dot @@ -1,47 +1,5 @@ digraph G { - graph [ratio=.48]; - node [style=filled, color=black, shape=circle, width=.6 - fontname=Helvetica, fontweight=bold, fontcolor=white, + 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"; }