From 9f80e4c657989f091244025349d5554da7c17b0d Mon Sep 17 00:00:00 2001 From: ptobgui300 Date: Thu, 7 Jan 2021 00:44:13 -0800 Subject: [PATCH] fix --- Java/Red and Black Tree/.classpath | 6 + Java/Red and Black Tree/.project | 23 + .../.settings/org.eclipse.jdt.core.prefs | 11 + Java/Red and Black Tree/bin/.classpath | 7 + .../bin/application/application.css | 1 + Java/Red and Black Tree/bin/rbtree/Main.class | Bin 0 -> 2047 bytes .../bin/rbtree/RBNode.class | Bin 0 -> 901 bytes .../bin/rbtree/RedBlackTree.class | Bin 0 -> 11447 bytes Java/Red and Black Tree/build.fxbuild | 8 + .../doc/allclasses-frame.html | 20 + .../doc/allclasses-noframe.html | 20 + .../doc/constant-values.html | 122 +++ .../doc/deprecated-list.html | 122 +++ Java/Red and Black Tree/doc/help-doc.html | 223 ++++ .../doc/index-files/index-1.html | 133 +++ .../doc/index-files/index-10.html | 129 +++ .../doc/index-files/index-2.html | 133 +++ .../doc/index-files/index-3.html | 129 +++ .../doc/index-files/index-4.html | 129 +++ .../doc/index-files/index-5.html | 153 +++ .../doc/index-files/index-6.html | 129 +++ .../doc/index-files/index-7.html | 133 +++ .../doc/index-files/index-8.html | 146 +++ .../doc/index-files/index-9.html | 139 +++ Java/Red and Black Tree/doc/index.html | 72 ++ .../Red and Black Tree/doc/overview-tree.html | 136 +++ Java/Red and Black Tree/doc/package-list | 1 + Java/Red and Black Tree/doc/rbtree/Main.html | 328 ++++++ .../Red and Black Tree/doc/rbtree/RBNode.html | 307 ++++++ .../doc/rbtree/RedBlackTree.html | 704 +++++++++++++ .../doc/rbtree/RedBlackTree.zip | Bin 0 -> 6527 bytes .../doc/rbtree/class-use/Main.html | 122 +++ .../doc/rbtree/class-use/RBNode.html | 290 ++++++ .../doc/rbtree/class-use/RedBlackTree.html | 122 +++ .../doc/rbtree/package-frame.html | 21 + .../doc/rbtree/package-summary.html | 144 +++ .../doc/rbtree/package-tree.html | 132 +++ .../doc/rbtree/package-use.html | 140 +++ .../doc/rbtree/private/allclasses-frame.html | 20 + .../rbtree/private/allclasses-noframe.html | 20 + .../doc/rbtree/private/constant-values.html | 122 +++ .../doc/rbtree/private/deprecated-list.html | 122 +++ .../doc/rbtree/private/help-doc.html | 223 ++++ .../rbtree/private/index-files/index-1.html | 133 +++ .../rbtree/private/index-files/index-10.html | 161 +++ .../rbtree/private/index-files/index-11.html | 147 +++ .../rbtree/private/index-files/index-12.html | 133 +++ .../rbtree/private/index-files/index-13.html | 129 +++ .../rbtree/private/index-files/index-2.html | 127 +++ .../rbtree/private/index-files/index-3.html | 135 +++ .../rbtree/private/index-files/index-4.html | 129 +++ .../rbtree/private/index-files/index-5.html | 133 +++ .../rbtree/private/index-files/index-6.html | 163 +++ .../rbtree/private/index-files/index-7.html | 131 +++ .../rbtree/private/index-files/index-8.html | 129 +++ .../rbtree/private/index-files/index-9.html | 135 +++ .../doc/rbtree/private/index.html | 72 ++ .../doc/rbtree/private/overview-tree.html | 136 +++ .../doc/rbtree/private/package-list | 1 + .../doc/rbtree/private/rbtree/RBNode.html | 395 +++++++ .../rbtree/private/rbtree/RedBlackTree.html | 981 ++++++++++++++++++ .../rbtree/private/rbtree/RedBlackTree.zip | Bin 0 -> 8204 bytes .../private/rbtree/class-use/RBNode.html | 436 ++++++++ .../rbtree/class-use/RedBlackTree.html | 122 +++ .../rbtree/private/rbtree/package-frame.html | 21 + .../private/rbtree/package-summary.html | 144 +++ .../rbtree/private/rbtree/package-tree.html | 132 +++ .../rbtree/private/rbtree/package-use.html | 140 +++ .../doc/rbtree/private/script.js | 30 + .../doc/rbtree/private/stylesheet.css | 574 ++++++++++ Java/Red and Black Tree/doc/script.js | 30 + Java/Red and Black Tree/doc/stylesheet.css | 574 ++++++++++ Java/Red and Black Tree/src/.classpath | 7 + .../src/application/application.css | 1 + Java/Red and Black Tree/src/rbtree/Main.java | 64 ++ .../Red and Black Tree/src/rbtree/RBNode.java | 36 + .../src/rbtree/RedBlackTree.java | 886 ++++++++++++++++ 77 files changed, 11509 insertions(+) create mode 100644 Java/Red and Black Tree/.classpath create mode 100644 Java/Red and Black Tree/.project create mode 100644 Java/Red and Black Tree/.settings/org.eclipse.jdt.core.prefs create mode 100644 Java/Red and Black Tree/bin/.classpath create mode 100644 Java/Red and Black Tree/bin/application/application.css create mode 100644 Java/Red and Black Tree/bin/rbtree/Main.class create mode 100644 Java/Red and Black Tree/bin/rbtree/RBNode.class create mode 100644 Java/Red and Black Tree/bin/rbtree/RedBlackTree.class create mode 100644 Java/Red and Black Tree/build.fxbuild create mode 100644 Java/Red and Black Tree/doc/allclasses-frame.html create mode 100644 Java/Red and Black Tree/doc/allclasses-noframe.html create mode 100644 Java/Red and Black Tree/doc/constant-values.html create mode 100644 Java/Red and Black Tree/doc/deprecated-list.html create mode 100644 Java/Red and Black Tree/doc/help-doc.html create mode 100644 Java/Red and Black Tree/doc/index-files/index-1.html create mode 100644 Java/Red and Black Tree/doc/index-files/index-10.html create mode 100644 Java/Red and Black Tree/doc/index-files/index-2.html create mode 100644 Java/Red and Black Tree/doc/index-files/index-3.html create mode 100644 Java/Red and Black Tree/doc/index-files/index-4.html create mode 100644 Java/Red and Black Tree/doc/index-files/index-5.html create mode 100644 Java/Red and Black Tree/doc/index-files/index-6.html create mode 100644 Java/Red and Black Tree/doc/index-files/index-7.html create mode 100644 Java/Red and Black Tree/doc/index-files/index-8.html create mode 100644 Java/Red and Black Tree/doc/index-files/index-9.html create mode 100644 Java/Red and Black Tree/doc/index.html create mode 100644 Java/Red and Black Tree/doc/overview-tree.html create mode 100644 Java/Red and Black Tree/doc/package-list create mode 100644 Java/Red and Black Tree/doc/rbtree/Main.html create mode 100644 Java/Red and Black Tree/doc/rbtree/RBNode.html create mode 100644 Java/Red and Black Tree/doc/rbtree/RedBlackTree.html create mode 100644 Java/Red and Black Tree/doc/rbtree/RedBlackTree.zip create mode 100644 Java/Red and Black Tree/doc/rbtree/class-use/Main.html create mode 100644 Java/Red and Black Tree/doc/rbtree/class-use/RBNode.html create mode 100644 Java/Red and Black Tree/doc/rbtree/class-use/RedBlackTree.html create mode 100644 Java/Red and Black Tree/doc/rbtree/package-frame.html create mode 100644 Java/Red and Black Tree/doc/rbtree/package-summary.html create mode 100644 Java/Red and Black Tree/doc/rbtree/package-tree.html create mode 100644 Java/Red and Black Tree/doc/rbtree/package-use.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/allclasses-frame.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/allclasses-noframe.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/constant-values.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/deprecated-list.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/help-doc.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index-files/index-1.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index-files/index-10.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index-files/index-11.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index-files/index-12.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index-files/index-13.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index-files/index-2.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index-files/index-3.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index-files/index-4.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index-files/index-5.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index-files/index-6.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index-files/index-7.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index-files/index-8.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index-files/index-9.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/index.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/overview-tree.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/package-list create mode 100644 Java/Red and Black Tree/doc/rbtree/private/rbtree/RBNode.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/rbtree/RedBlackTree.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/rbtree/RedBlackTree.zip create mode 100644 Java/Red and Black Tree/doc/rbtree/private/rbtree/class-use/RBNode.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/rbtree/class-use/RedBlackTree.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/rbtree/package-frame.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/rbtree/package-summary.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/rbtree/package-tree.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/rbtree/package-use.html create mode 100644 Java/Red and Black Tree/doc/rbtree/private/script.js create mode 100644 Java/Red and Black Tree/doc/rbtree/private/stylesheet.css create mode 100644 Java/Red and Black Tree/doc/script.js create mode 100644 Java/Red and Black Tree/doc/stylesheet.css create mode 100644 Java/Red and Black Tree/src/.classpath create mode 100644 Java/Red and Black Tree/src/application/application.css create mode 100644 Java/Red and Black Tree/src/rbtree/Main.java create mode 100644 Java/Red and Black Tree/src/rbtree/RBNode.java create mode 100644 Java/Red and Black Tree/src/rbtree/RedBlackTree.java diff --git a/Java/Red and Black Tree/.classpath b/Java/Red and Black Tree/.classpath new file mode 100644 index 0000000..54e318a --- /dev/null +++ b/Java/Red and Black Tree/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/Java/Red and Black Tree/.project b/Java/Red and Black Tree/.project new file mode 100644 index 0000000..6bd0b62 --- /dev/null +++ b/Java/Red and Black Tree/.project @@ -0,0 +1,23 @@ + + + Red and Black Tree + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + + org.eclipse.xtext.ui.shared.xtextNature + org.eclipse.jdt.core.javanature + + diff --git a/Java/Red and Black Tree/.settings/org.eclipse.jdt.core.prefs b/Java/Red and Black Tree/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..3a21537 --- /dev/null +++ b/Java/Red and Black Tree/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Java/Red and Black Tree/bin/.classpath b/Java/Red and Black Tree/bin/.classpath new file mode 100644 index 0000000..3b2e843 --- /dev/null +++ b/Java/Red and Black Tree/bin/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Java/Red and Black Tree/bin/application/application.css b/Java/Red and Black Tree/bin/application/application.css new file mode 100644 index 0000000..83d6f33 --- /dev/null +++ b/Java/Red and Black Tree/bin/application/application.css @@ -0,0 +1 @@ +/* JavaFX CSS - Leave this comment until you have at least create one rule which uses -fx-Property */ \ No newline at end of file diff --git a/Java/Red and Black Tree/bin/rbtree/Main.class b/Java/Red and Black Tree/bin/rbtree/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..20bc3add4a3cf61a868edabb839b74f9d6433bcc GIT binary patch literal 2047 zcmZ`)T~`}b6x{=XNy5+$6pF1a25c+e(Mqe5O3SC#hC&IYLhHvR+=hY4Ogb}Avh@G> zTpvP}r4K&(JNz9k_q~&luv8Xn?wvd5p0m&1=bZfc_piSLm`2q^n}M!iCkmv@t_a67 zkuWg0FOI~^>x&AoxndyeNsvj*BnMmG&47W`eAMmtg#I?!q0V&3uO zPCE=E!IRX3=+DSyXg|+0~s;21hE{ zyc0&bG~UCIiHreT;UQqJM4Nq@TNuXs29k8V;EIqgFV$VfR{AiP#7*+rqR3P+4Ab}k zqb5f9rRi1MT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diff --git a/Java/Red and Black Tree/bin/rbtree/RedBlackTree.class b/Java/Red and Black Tree/bin/rbtree/RedBlackTree.class new file mode 100644 index 0000000000000000000000000000000000000000..b9d3b99a15927a6f4be9ddfc727fd68a63f33520 GIT binary patch literal 11447 zcmcIq3t&{`mHz&FCz(ld6GBJ=;Tb?6$t0ktun-c4r#zB?fT#${kPI*~c{rJ%xb1FN z(OtE+TOZvGRqJCl+9KkEAX2HWUC_F%wfL;o>bkbOecG<8T}9LH{QsRhlSxuvTSe}@ z|9}4TpYxsXoc}R?|D#8a060yJ_QO&b5#N%CM_EyJ>lY zLiW69TQpJ6&x*?RRJe%ab77;vK`!!gz-b+1AzLPiwndt{TDL^v>%v=NR9w{1-W-mt z567eO?Kb)n+oPQdCElcIZgAGp{$qA^B*%>&Y(Uc1(G}-4q`Y6$-r5n4%bc}hv%lgz zx>UK|kI@SG{gB8-8ODky;}ps&hEkDBFDE!C$3%{gwsl70iAAwUxb3VC`dH!FWw5PW zpF^dS9h`(I#H%Ho2#Z&PS|^gz98?H=*)%!QmXNus90bLpY%>=h_uo&73F`+Y4O?wS<)Ep&;jtHMxnqcj<&b0ZjZ{4X+!y*;hdl(SoUu= zQOLtzVXhx@NT|V_bx@0WBwn))PGns>Igmc9p=@pCasj2@!F&P57mI97NW%gL3#B0| z9^JN`2HQI#M8l>ngh`u3*cHxjkb`W&aJhpOSV;|AqirpJCb%0!xY5CBIGx&?w?|`? zHX1h&)M)3D){cZsRZ+?B>}Y30B)oO7u(Nk$1{Vx2GS1h=w4w7Ial$PL8^AdV z2kUX3!jz1`wHwknvo^tj+sI)VvB|;tLd62DO%i&2IMzk=RT(PG{DbQ8gRC5xij$dO zVHe$x#BF>F_wdTlK_y^97KJS6qj2k;eYoY&SBi`5GR z1yb?8=HNP9&k43g5{q?x8r2VmwE8JyZWQFdo&k6=T?ZJG1U!I$X8oy<SrbZ{&3XoyB5#*pW=b+s;%BxETYEX!EWhR8DZP=A+HGe@#*UHjrl zERtYaWVh%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{3<&w}5c zjRJcPitSpAx9c$3u1AGEA1B)jaJsz^A$u_?yp$9^gA`sy3a=oA8%W_MQg{_9yqXkV zLkh1Wh1Zk9XOqI`kizGZ!sn5~oA8u<0cjj2jkl1-&7^S)X}p~@j*`YZNaGl3+(sI= hlg1sSao6Xhaq0g9jY~=QPe)^3vXRWAWC7u`>`w!nXBYqg literal 0 HcmV?d00001 diff --git a/Java/Red and Black Tree/build.fxbuild b/Java/Red and Black Tree/build.fxbuild new file mode 100644 index 0000000..d9407ee --- /dev/null +++ b/Java/Red and Black Tree/build.fxbuild @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Java/Red and Black Tree/doc/allclasses-frame.html b/Java/Red and Black Tree/doc/allclasses-frame.html new file mode 100644 index 0000000..7063800 --- /dev/null +++ b/Java/Red and Black Tree/doc/allclasses-frame.html @@ -0,0 +1,20 @@ + + + + + +All Classes + + + + + +

All Classes

+ + + diff --git a/Java/Red and Black Tree/doc/allclasses-noframe.html b/Java/Red and Black Tree/doc/allclasses-noframe.html new file mode 100644 index 0000000..54c40cd --- /dev/null +++ b/Java/Red and Black Tree/doc/allclasses-noframe.html @@ -0,0 +1,20 @@ + + + + + +All Classes + + + + + +

All Classes

+ + + diff --git a/Java/Red and Black Tree/doc/constant-values.html b/Java/Red and Black Tree/doc/constant-values.html new file mode 100644 index 0000000..75d00ab --- /dev/null +++ b/Java/Red and Black Tree/doc/constant-values.html @@ -0,0 +1,122 @@ + + + + + +Constant Field Values + + + + + + + + + + + +
+

Constant Field Values

+

Contents

+
+ + + + + + diff --git a/Java/Red and Black Tree/doc/deprecated-list.html b/Java/Red and Black Tree/doc/deprecated-list.html new file mode 100644 index 0000000..d4ac276 --- /dev/null +++ b/Java/Red and Black Tree/doc/deprecated-list.html @@ -0,0 +1,122 @@ + + + + + +Deprecated List + + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/help-doc.html b/Java/Red and Black Tree/doc/help-doc.html new file mode 100644 index 0000000..b5eb092 --- /dev/null +++ b/Java/Red and Black Tree/doc/help-doc.html @@ -0,0 +1,223 @@ + + + + + +API Help + + + + + + + + + + + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Use

    +

    Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.

    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ + + + + + diff --git a/Java/Red and Black Tree/doc/index-files/index-1.html b/Java/Red and Black Tree/doc/index-files/index-1.html new file mode 100644 index 0000000..d843561 --- /dev/null +++ b/Java/Red and Black Tree/doc/index-files/index-1.html @@ -0,0 +1,133 @@ + + + + + +B-Index + + + + + + + + +
+ + + + + + + +
+ + +
B D F G I M N P R S  + + +

B

+
+
breadthfirst() - Method in class rbtree.RedBlackTree
+
+
A helper method for the breadth first traversal method.
+
+
breadthfirst(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Traverses through the red black tree using breadth first algorithm.
+
+
+B D F G I M N P R S 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/index-files/index-10.html b/Java/Red and Black Tree/doc/index-files/index-10.html new file mode 100644 index 0000000..e026113 --- /dev/null +++ b/Java/Red and Black Tree/doc/index-files/index-10.html @@ -0,0 +1,129 @@ + + + + + +S-Index + + + + + + + + +
+ + + + + + + +
+ + +
B D F G I M N P R S  + + +

S

+
+
setData(E) - Method in class rbtree.RBNode
+
+
A setter for the node.
+
+
+B D F G I M N P R S 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/index-files/index-2.html b/Java/Red and Black Tree/doc/index-files/index-2.html new file mode 100644 index 0000000..72cf41d --- /dev/null +++ b/Java/Red and Black Tree/doc/index-files/index-2.html @@ -0,0 +1,133 @@ + + + + + +D-Index + + + + + + + + +
+ + + + + + + +
+ + +
B D F G I M N P R S  + + +

D

+
+
delete(E) - Method in class rbtree.RedBlackTree
+
+
A helper method to delete a node.
+
+
delete(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Deletes the node.
+
+
+B D F G I M N P R S 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/index-files/index-3.html b/Java/Red and Black Tree/doc/index-files/index-3.html new file mode 100644 index 0000000..6deb2d2 --- /dev/null +++ b/Java/Red and Black Tree/doc/index-files/index-3.html @@ -0,0 +1,129 @@ + + + + + +F-Index + + + + + + + + +
+ + + + + + + +
+ + +
B D F G I M N P R S  + + +

F

+
+
find(E) - Method in class rbtree.RedBlackTree
+
+
Finds if the data exists in red black tree based off of parameter.
+
+
+B D F G I M N P R S 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/index-files/index-4.html b/Java/Red and Black Tree/doc/index-files/index-4.html new file mode 100644 index 0000000..f3c87b9 --- /dev/null +++ b/Java/Red and Black Tree/doc/index-files/index-4.html @@ -0,0 +1,129 @@ + + + + + +G-Index + + + + + + + + +
+ + + + + + + +
+ + +
B D F G I M N P R S  + + +

G

+
+
getData() - Method in class rbtree.RBNode
+
+
A getter for the value inside the node.
+
+
+B D F G I M N P R S 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/index-files/index-5.html b/Java/Red and Black Tree/doc/index-files/index-5.html new file mode 100644 index 0000000..e185732 --- /dev/null +++ b/Java/Red and Black Tree/doc/index-files/index-5.html @@ -0,0 +1,153 @@ + + + + + +I-Index + + + + + + + + +
+ + + + + + + +
+ + +
B D F G I M N P R S  + + +

I

+
+
inorder() - Method in class rbtree.RedBlackTree
+
+
A helper method for the in order traversal method.
+
+
insert(E) - Method in class rbtree.RedBlackTree
+
+
Inserts a node into the red and black tree.
+
+
insertionPoint(E) - Method in class rbtree.RedBlackTree
+
+
Finds the spot of the parent of the node we will be inserting into the tree.
+
+
isEmpty() - Method in class rbtree.RedBlackTree
+
+
Checks to see if a tree is empty or not.
+
+
isLeaf(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Checks to see if a node is a leaf.
+
+
isLeftChild(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Checks if a node is a left child.
+
+
isRightChild(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Checks if a node is a right child.
+
+
+B D F G I M N P R S 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/index-files/index-6.html b/Java/Red and Black Tree/doc/index-files/index-6.html new file mode 100644 index 0000000..e9d48e9 --- /dev/null +++ b/Java/Red and Black Tree/doc/index-files/index-6.html @@ -0,0 +1,129 @@ + + + + + +M-Index + + + + + + + + +
+ + + + + + + +
+ + +
B D F G I M N P R S  + + +

M

+
+
maxLeftSubtree(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Finds the max node in the left sub tree of a node.
+
+
+B D F G I M N P R S 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/index-files/index-7.html b/Java/Red and Black Tree/doc/index-files/index-7.html new file mode 100644 index 0000000..e145903 --- /dev/null +++ b/Java/Red and Black Tree/doc/index-files/index-7.html @@ -0,0 +1,133 @@ + + + + + +N-Index + + + + + + + + +
+ + + + + + + +
+ + +
B D F G I M N P R S  + + +

N

+
+
nodeToDelete(E) - Method in class rbtree.RedBlackTree
+
+
Finds the node that will be deleted.
+
+
numChildren(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Counts the number of children of a node in the red black tree.
+
+
+B D F G I M N P R S 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/index-files/index-8.html b/Java/Red and Black Tree/doc/index-files/index-8.html new file mode 100644 index 0000000..db8eb0d --- /dev/null +++ b/Java/Red and Black Tree/doc/index-files/index-8.html @@ -0,0 +1,146 @@ + + + + + +P-Index + + + + + + + + +
+ + + + + + + +
+ + +
B D F G I M N P R S  + + +

P

+
+
postorder() - Method in class rbtree.RedBlackTree
+
+
A helper method for the post order traversal method.
+
+
preorder() - Method in class rbtree.RedBlackTree
+
+
A helper method for the pre order traversal method.
+
+
preorder(RBNode<E>, ArrayList<RBNode<E>>) - Method in class rbtree.RedBlackTree
+
+
Traverses through the red black tree using the pre order traversal, and puts + values into an array list.
+
+
printList(ArrayList<RBNode<E>>) - Method in class rbtree.RedBlackTree
+
+
Prints an array list.
+
+
printTree() - Method in class rbtree.RedBlackTree
+
+
Prints the tree.
+
+
+B D F G I M N P R S 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/index-files/index-9.html b/Java/Red and Black Tree/doc/index-files/index-9.html new file mode 100644 index 0000000..dd83197 --- /dev/null +++ b/Java/Red and Black Tree/doc/index-files/index-9.html @@ -0,0 +1,139 @@ + + + + + +R-Index + + + + + + + + +
+ + + + + + + +
+ + +
B D F G I M N P R S  + + +

R

+
+
RBNode<E extends java.lang.Comparable<E>> - Class in rbtree
+
 
+
RBNode(E) - Constructor for class rbtree.RBNode
+
+
Creates an RBNode.
+
+
rbtree - package rbtree
+
 
+
RedBlackTree<E extends java.lang.Comparable<E>> - Class in rbtree
+
 
+
RedBlackTree() - Constructor for class rbtree.RedBlackTree
+
 
+
RedBlackTree(E[]) - Constructor for class rbtree.RedBlackTree
+
 
+
+B D F G I M N P R S 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/index.html b/Java/Red and Black Tree/doc/index.html new file mode 100644 index 0000000..72167be --- /dev/null +++ b/Java/Red and Black Tree/doc/index.html @@ -0,0 +1,72 @@ + + + + + +Generated Documentation (Untitled) + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="rbtree/package-summary.html">Non-frame version</a>.</p> + + + diff --git a/Java/Red and Black Tree/doc/overview-tree.html b/Java/Red and Black Tree/doc/overview-tree.html new file mode 100644 index 0000000..af3e888 --- /dev/null +++ b/Java/Red and Black Tree/doc/overview-tree.html @@ -0,0 +1,136 @@ + + + + + +Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/Java/Red and Black Tree/doc/package-list b/Java/Red and Black Tree/doc/package-list new file mode 100644 index 0000000..893ee01 --- /dev/null +++ b/Java/Red and Black Tree/doc/package-list @@ -0,0 +1 @@ +rbtree diff --git a/Java/Red and Black Tree/doc/rbtree/Main.html b/Java/Red and Black Tree/doc/rbtree/Main.html new file mode 100644 index 0000000..df07c79 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/Main.html @@ -0,0 +1,328 @@ + + + + + +Main + + + + + + + + + + + + +
+
rbtree
+

Class Main

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javafx.application.Application
    • +
    • +
        +
      • rbtree.Main
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class Main
    +extends javafx.application.Application
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javafx.application.Application

        +javafx.application.Application.Parameters
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class javafx.application.Application

        +STYLESHEET_CASPIAN, STYLESHEET_MODENA
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Main() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      voidstart(javafx.stage.Stage primaryStage) 
      +
        +
      • + + +

        Methods inherited from class javafx.application.Application

        +getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet, stop
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Main

        +
        public Main()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        start

        +
        public void start(javafx.stage.Stage primaryStage)
        +
        +
        Specified by:
        +
        start in class javafx.application.Application
        +
        +
      • +
      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/RBNode.html b/Java/Red and Black Tree/doc/rbtree/RBNode.html new file mode 100644 index 0000000..b8471aa --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/RBNode.html @@ -0,0 +1,307 @@ + + + + + +RBNode + + + + + + + + + + + + +
+
rbtree
+

Class RBNode<E extends java.lang.Comparable<E>>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • rbtree.RBNode<E>
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class RBNode<E extends java.lang.Comparable<E>>
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      RBNode(E data) +
      Creates an RBNode.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      EgetData() +
      A getter for the value inside the node.
      +
      voidsetData(E data) +
      A setter for the node.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + + + +
        +
      • +

        RBNode

        +
        public RBNode(E data)
        +
        Creates an RBNode.
        +
        +
        Parameters:
        +
        data - is the data that is stored in the given node.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        setData

        +
        public void setData(E data)
        +
        A setter for the node.
        +
        +
        Parameters:
        +
        data - is the value that will be set into the node.
        +
        +
      • +
      + + + +
        +
      • +

        getData

        +
        public E getData()
        +
        A getter for the value inside the node.
        +
        +
        Returns:
        +
        the data in the node.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/RedBlackTree.html b/Java/Red and Black Tree/doc/rbtree/RedBlackTree.html new file mode 100644 index 0000000..774b39a --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/RedBlackTree.html @@ -0,0 +1,704 @@ + + + + + +RedBlackTree + + + + + + + + + + + + +
+
rbtree
+

Class RedBlackTree<E extends java.lang.Comparable<E>>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • rbtree.RedBlackTree<E>
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class RedBlackTree<E extends java.lang.Comparable<E>>
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.util.ArrayList<RBNode<E>>breadthfirst() +
      A helper method for the breadth first traversal method.
      +
      java.util.ArrayList<RBNode<E>>breadthfirst(RBNode<E> node) +
      Traverses through the red black tree using breadth first algorithm.
      +
      voiddelete(E key) +
      A helper method to delete a node.
      +
      voiddelete(RBNode<E> node) +
      Deletes the node.
      +
      booleanfind(E key) +
      Finds if the data exists in red black tree based off of parameter.
      +
      java.util.ArrayList<RBNode<E>>inorder() +
      A helper method for the in order traversal method.
      +
      voidinsert(E key) +
      Inserts a node into the red and black tree.
      +
      RBNode<E>insertionPoint(E key) +
      Finds the spot of the parent of the node we will be inserting into the tree.
      +
      booleanisEmpty() +
      Checks to see if a tree is empty or not.
      +
      booleanisLeaf(RBNode<E> node) +
      Checks to see if a node is a leaf.
      +
      booleanisLeftChild(RBNode<E> node) +
      Checks if a node is a left child.
      +
      booleanisRightChild(RBNode<E> node) +
      Checks if a node is a right child.
      +
      RBNode<E>maxLeftSubtree(RBNode<E> node) +
      Finds the max node in the left sub tree of a node.
      +
      RBNode<E>nodeToDelete(E key) +
      Finds the node that will be deleted.
      +
      intnumChildren(RBNode<E> node) +
      Counts the number of children of a node in the red black tree.
      +
      java.util.ArrayList<RBNode<E>>postorder() +
      A helper method for the post order traversal method.
      +
      java.util.ArrayList<RBNode<E>>preorder() +
      A helper method for the pre order traversal method.
      +
      java.util.ArrayList<RBNode<E>>preorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the pre order traversal, and puts + values into an array list.
      +
      voidprintList(java.util.ArrayList<RBNode<E>> myList) +
      Prints an array list.
      +
      voidprintTree() +
      Prints the tree.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RedBlackTree

        +
        public RedBlackTree()
        +
      • +
      + + + + + +
        +
      • +

        RedBlackTree

        +
        public RedBlackTree(E[] myArray)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        insertionPoint

        +
        public RBNode<E> insertionPoint(E key)
        +
        Finds the spot of the parent of the node we will be inserting into the tree.
        +
        +
        Parameters:
        +
        key - is the data inside the node.
        +
        Returns:
        +
        the parent of the new node we are going to insert.
        +
        +
      • +
      + + + + + +
        +
      • +

        insert

        +
        public void insert(E key)
        +
        Inserts a node into the red and black tree.
        +
        +
        Parameters:
        +
        key - is the data which will be inside of the new node.
        +
        +
      • +
      + + + + + +
        +
      • +

        find

        +
        public boolean find(E key)
        +
        Finds if the data exists in red black tree based off of parameter.
        +
        +
        Parameters:
        +
        key - is the data being searched in the tree.
        +
        Returns:
        +
        true if key is found, and false if it is not found.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Checks to see if a tree is empty or not.
        +
        +
        Returns:
        +
        true if tree is empty. False if tree is not empty.
        +
        +
      • +
      + + + +
        +
      • +

        isLeaf

        +
        public boolean isLeaf(RBNode<E> node)
        +
        Checks to see if a node is a leaf.
        +
        +
        Parameters:
        +
        node - is the node we are checking.
        +
        Returns:
        +
        true if the node is a leaf, and false if it is not a leaf.
        +
        +
      • +
      + + + +
        +
      • +

        printTree

        +
        public void printTree()
        +
        Prints the tree.
        +
      • +
      + + + +
        +
      • +

        numChildren

        +
        public int numChildren(RBNode<E> node)
        +
        Counts the number of children of a node in the red black tree.
        +
        +
        Parameters:
        +
        node - is the node we are checking.
        +
        Returns:
        +
        the count of the number of children that the node has.
        +
        +
      • +
      + + + + + +
        +
      • +

        nodeToDelete

        +
        public RBNode<E> nodeToDelete(E key)
        +
        Finds the node that will be deleted.
        +
        +
        Parameters:
        +
        key - is the data inside that node.
        +
        Returns:
        +
        the node if it exists, and null if it does not.
        +
        +
      • +
      + + + + + +
        +
      • +

        delete

        +
        public void delete(E key)
        +
        A helper method to delete a node.
        +
        +
        Parameters:
        +
        key - is the value of the node that is going to be deleted.
        +
        +
      • +
      + + + +
        +
      • +

        delete

        +
        public void delete(RBNode<E> node)
        +
        Deletes the node.
        +
        +
        Parameters:
        +
        node - is the node that is going to be deleted.
        +
        +
      • +
      + + + +
        +
      • +

        maxLeftSubtree

        +
        public RBNode<E> maxLeftSubtree(RBNode<E> node)
        +
        Finds the max node in the left sub tree of a node.
        +
        +
        Parameters:
        +
        node - is the node we are checking.
        +
        Returns:
        +
        the max node in the left sub tree.
        +
        +
      • +
      + + + +
        +
      • +

        isLeftChild

        +
        public boolean isLeftChild(RBNode<E> node)
        +
        Checks if a node is a left child.
        +
        +
        Parameters:
        +
        node - is the node we are checking.
        +
        Returns:
        +
        true if the node is a left child, and false if it is not a left + child.
        +
        +
      • +
      + + + +
        +
      • +

        isRightChild

        +
        public boolean isRightChild(RBNode<E> node)
        +
        Checks if a node is a right child.
        +
        +
        Parameters:
        +
        node - is the node we are checking.
        +
        Returns:
        +
        true if the node is a right child, and false if it is not a right + child.
        +
        +
      • +
      + + + +
        +
      • +

        preorder

        +
        public java.util.ArrayList<RBNode<E>> preorder()
        +
        A helper method for the pre order traversal method.
        +
        +
        Returns:
        +
        an array list with the correct traversal.
        +
        +
      • +
      + + + +
        +
      • +

        preorder

        +
        public java.util.ArrayList<RBNode<E>> preorder(RBNode<E> node,
        +                                               java.util.ArrayList<RBNode<E>> myList)
        +
        Traverses through the red black tree using the pre order traversal, and puts + values into an array list.
        +
        +
        Parameters:
        +
        node - the node being sent into method.
        +
        myList - is the array list used to store nodes.
        +
        Returns:
        +
        the array list with the nodes in the appropriate order.
        +
        +
      • +
      + + + +
        +
      • +

        postorder

        +
        public java.util.ArrayList<RBNode<E>> postorder()
        +
        A helper method for the post order traversal method.
        +
        +
        Returns:
        +
        an array list with the correct traversal.
        +
        +
      • +
      + + + +
        +
      • +

        inorder

        +
        public java.util.ArrayList<RBNode<E>> inorder()
        +
        A helper method for the in order traversal method.
        +
        +
        Returns:
        +
        an array list with the correct traversal.
        +
        +
      • +
      + + + +
        +
      • +

        breadthfirst

        +
        public java.util.ArrayList<RBNode<E>> breadthfirst()
        +
        A helper method for the breadth first traversal method.
        +
        +
        Returns:
        +
        an array list with the correct traversal.
        +
        +
      • +
      + + + +
        +
      • +

        breadthfirst

        +
        public java.util.ArrayList<RBNode<E>> breadthfirst(RBNode<E> node)
        +
        Traverses through the red black tree using breadth first algorithm. Inputs + into an array list accordingly.
        +
        +
        Parameters:
        +
        node - is the root of the red black tree.
        +
        Returns:
        +
        an array list of nodes.
        +
        +
      • +
      + + + +
        +
      • +

        printList

        +
        public void printList(java.util.ArrayList<RBNode<E>> myList)
        +
        Prints an array list.
        +
        +
        Parameters:
        +
        myList - the list of RBNode that is going to be printed.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/RedBlackTree.zip b/Java/Red and Black Tree/doc/rbtree/RedBlackTree.zip new file mode 100644 index 0000000000000000000000000000000000000000..93befde00d9727255c32b5c69116e813a6d88a5a GIT binary patch literal 6527 zcmZ{pRa6@ckc9&jEA9lhBE?Dz6b}G_RQ?|Ius1qZ})Nt?ai8mm-&jjwZ&OXbexHoq9l^Q#^l|0KFIvC?_dK?Nn9lDr)w? z-5+u2DKr#fu3x{3*iS-g41sSNlP~y}y17~r*p1y^<^6_rbvdk_G)qBNfQFDk=*Fq% z)4N#fA1{R! z&+cO=@SWl+!~&?L%G#=6s%Aau`k6IG;B&7{uP>>F_3=?F#3U-}-uNu+-N9{D*h|SlQ(K!KIuE3v(G8 zgm1W}WN}uyBg0nr+p%rCkxCmo>)&VDiR@)5p7T?at|ecOv&sR_Du+Y(?XcW%^7Zl! z7wM_wc?8`CWDQ(+!Z&v;Wh918B@0t8m8jU7TCcaCCklFL-tvWOvQs{f*kn6kYQxWNqB)= z;rpwp1K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bwayLf4h6k2z3*) z)L*2?_37s_4le#4@Z$bihNuxyiWNOOm&m#t1-Pb#Pct#R78St|LZN)~!=O{5G|Pf} z2P0b=6@4LERFOXf#Ency0aPwaTNtM90?hRROYvAOQ0Dfn2#z4Znq){}iN45dwCAxy&fqkApi_xU@FmaCU7DZ&E6tkUOVKiINZTKfq zSA%!Prkgo2voTe^#1}bNpdvtZWS(?BK&Djn*x8nkF)}ImMKo|HEGiV`kc8`33MeW( znK!0oNFBS=77qSM{*;lW=Bh}ml-6O4#!nMaOF5+ORw3;O{+sbx8<@y3Ugyd9@u+U; zP9$uccc4OvIy&xP+_wEyg)m^j<4^|^y}9w=V<|Eu0=e{yJ~i5S>p)1HD-+*?sH8@& zagNsaumk0x(LF}sLE~K4=LxQcF|vxxzhFjP)^%C_ubc=#WEolZRPRL!0Oe2u9CT;4 zM{tnD6oQJ1zHY3>ofhF8q~|i`j#rUL6%$s>y3*|+h0^O1bF@%PP}*YHbO&+W>QabG#H zZISHR?m{go189lYeA6RevGGpvs#b-iiHS~kcNNr6|K8J2Utc_ZMD>OAl)d?`wwB|z zr`p%g@?Nr*qm^ZQ>7b7o&to949L@0Z)cJxIFaJCMtb~M24EX;ekAHj<00}_%@A#+w pPXO}2<^S7r{VV!UdG|j#%71fUU?o(vf1k+zwAVlLoc!PIKLF>#Xr%xE literal 0 HcmV?d00001 diff --git a/Java/Red and Black Tree/doc/rbtree/class-use/Main.html b/Java/Red and Black Tree/doc/rbtree/class-use/Main.html new file mode 100644 index 0000000..3ad7f5a --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/class-use/Main.html @@ -0,0 +1,122 @@ + + + + + +Uses of Class rbtree.Main + + + + + + + + + + + +
+

Uses of Class
rbtree.Main

+
+
No usage of rbtree.Main
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/class-use/RBNode.html b/Java/Red and Black Tree/doc/rbtree/class-use/RBNode.html new file mode 100644 index 0000000..8ab850e --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/class-use/RBNode.html @@ -0,0 +1,290 @@ + + + + + +Uses of Class rbtree.RBNode + + + + + + + + + + + +
+

Uses of Class
rbtree.RBNode

+
+
+
    +
  • +
      +
    • + + +

      Uses of RBNode in rbtree

      + + + + + + + + + + + + + + + + + + + + +
      Methods in rbtree that return RBNode 
      Modifier and TypeMethod and Description
      RBNode<E>RedBlackTree.insertionPoint(E key) +
      Finds the spot of the parent of the node we will be inserting into the tree.
      +
      RBNode<E>RedBlackTree.maxLeftSubtree(RBNode<E> node) +
      Finds the max node in the left sub tree of a node.
      +
      RBNode<E>RedBlackTree.nodeToDelete(E key) +
      Finds the node that will be deleted.
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in rbtree that return types with arguments of type RBNode 
      Modifier and TypeMethod and Description
      java.util.ArrayList<RBNode<E>>RedBlackTree.breadthfirst() +
      A helper method for the breadth first traversal method.
      +
      java.util.ArrayList<RBNode<E>>RedBlackTree.breadthfirst(RBNode<E> node) +
      Traverses through the red black tree using breadth first algorithm.
      +
      java.util.ArrayList<RBNode<E>>RedBlackTree.inorder() +
      A helper method for the in order traversal method.
      +
      java.util.ArrayList<RBNode<E>>RedBlackTree.postorder() +
      A helper method for the post order traversal method.
      +
      java.util.ArrayList<RBNode<E>>RedBlackTree.preorder() +
      A helper method for the pre order traversal method.
      +
      java.util.ArrayList<RBNode<E>>RedBlackTree.preorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the pre order traversal, and puts + values into an array list.
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in rbtree with parameters of type RBNode 
      Modifier and TypeMethod and Description
      java.util.ArrayList<RBNode<E>>RedBlackTree.breadthfirst(RBNode<E> node) +
      Traverses through the red black tree using breadth first algorithm.
      +
      voidRedBlackTree.delete(RBNode<E> node) +
      Deletes the node.
      +
      booleanRedBlackTree.isLeaf(RBNode<E> node) +
      Checks to see if a node is a leaf.
      +
      booleanRedBlackTree.isLeftChild(RBNode<E> node) +
      Checks if a node is a left child.
      +
      booleanRedBlackTree.isRightChild(RBNode<E> node) +
      Checks if a node is a right child.
      +
      RBNode<E>RedBlackTree.maxLeftSubtree(RBNode<E> node) +
      Finds the max node in the left sub tree of a node.
      +
      intRedBlackTree.numChildren(RBNode<E> node) +
      Counts the number of children of a node in the red black tree.
      +
      java.util.ArrayList<RBNode<E>>RedBlackTree.preorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the pre order traversal, and puts + values into an array list.
      +
      + + + + + + + + + + + + + + + + +
      Method parameters in rbtree with type arguments of type RBNode 
      Modifier and TypeMethod and Description
      java.util.ArrayList<RBNode<E>>RedBlackTree.preorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the pre order traversal, and puts + values into an array list.
      +
      voidRedBlackTree.printList(java.util.ArrayList<RBNode<E>> myList) +
      Prints an array list.
      +
      +
    • +
    +
  • +
+
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/class-use/RedBlackTree.html b/Java/Red and Black Tree/doc/rbtree/class-use/RedBlackTree.html new file mode 100644 index 0000000..886336c --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/class-use/RedBlackTree.html @@ -0,0 +1,122 @@ + + + + + +Uses of Class rbtree.RedBlackTree + + + + + + + + + + + +
+

Uses of Class
rbtree.RedBlackTree

+
+
No usage of rbtree.RedBlackTree
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/package-frame.html b/Java/Red and Black Tree/doc/rbtree/package-frame.html new file mode 100644 index 0000000..8fc8e77 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/package-frame.html @@ -0,0 +1,21 @@ + + + + + +rbtree + + + + + +

rbtree

+
+

Classes

+ +
+ + diff --git a/Java/Red and Black Tree/doc/rbtree/package-summary.html b/Java/Red and Black Tree/doc/rbtree/package-summary.html new file mode 100644 index 0000000..79fdbcf --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/package-summary.html @@ -0,0 +1,144 @@ + + + + + +rbtree + + + + + + + + + + + +
+

Package rbtree

+
+
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    RBNode<E extends java.lang.Comparable<E>> 
    RedBlackTree<E extends java.lang.Comparable<E>> 
    +
  • +
+
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/package-tree.html b/Java/Red and Black Tree/doc/rbtree/package-tree.html new file mode 100644 index 0000000..a608a0c --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/package-tree.html @@ -0,0 +1,132 @@ + + + + + +rbtree Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package rbtree

+
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/package-use.html b/Java/Red and Black Tree/doc/rbtree/package-use.html new file mode 100644 index 0000000..7b00d8f --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/package-use.html @@ -0,0 +1,140 @@ + + + + + +Uses of Package rbtree + + + + + + + + + + + +
+

Uses of Package
rbtree

+
+
+ +
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/allclasses-frame.html b/Java/Red and Black Tree/doc/rbtree/private/allclasses-frame.html new file mode 100644 index 0000000..fe37d47 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/allclasses-frame.html @@ -0,0 +1,20 @@ + + + + + +All Classes + + + + + +

All Classes

+ + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/allclasses-noframe.html b/Java/Red and Black Tree/doc/rbtree/private/allclasses-noframe.html new file mode 100644 index 0000000..27e48f7 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/allclasses-noframe.html @@ -0,0 +1,20 @@ + + + + + +All Classes + + + + + +

All Classes

+ + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/constant-values.html b/Java/Red and Black Tree/doc/rbtree/private/constant-values.html new file mode 100644 index 0000000..e5b9a01 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/constant-values.html @@ -0,0 +1,122 @@ + + + + + +Constant Field Values + + + + + + + + + + + +
+

Constant Field Values

+

Contents

+
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/deprecated-list.html b/Java/Red and Black Tree/doc/rbtree/private/deprecated-list.html new file mode 100644 index 0000000..5d844d2 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/deprecated-list.html @@ -0,0 +1,122 @@ + + + + + +Deprecated List + + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/help-doc.html b/Java/Red and Black Tree/doc/rbtree/private/help-doc.html new file mode 100644 index 0000000..8d7b81b --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/help-doc.html @@ -0,0 +1,223 @@ + + + + + +API Help + + + + + + + + + + + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Use

    +

    Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.

    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index-files/index-1.html b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-1.html new file mode 100644 index 0000000..5ea2bc2 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-1.html @@ -0,0 +1,133 @@ + + + + + +B-Index + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G I L M N P R S U  + + +

B

+
+
breadthfirst() - Method in class rbtree.RedBlackTree
+
+
A helper method for the breadth first traversal method.
+
+
breadthfirst(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Traverses through the red black tree using breadth first algorithm.
+
+
+B C D F G I L M N P R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index-files/index-10.html b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-10.html new file mode 100644 index 0000000..88ab6f0 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-10.html @@ -0,0 +1,161 @@ + + + + + +P-Index + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G I L M N P R S U  + + +

P

+
+
parent - Variable in class rbtree.RBNode
+
 
+
postorder() - Method in class rbtree.RedBlackTree
+
+
A helper method for the post order traversal method.
+
+
postorder(RBNode<E>, ArrayList<RBNode<E>>) - Method in class rbtree.RedBlackTree
+
+
Traverses through the red black tree using the post order traversal, and puts + values into an array list.
+
+
preorder() - Method in class rbtree.RedBlackTree
+
+
A helper method for the pre order traversal method.
+
+
preorder(RBNode<E>, ArrayList<RBNode<E>>) - Method in class rbtree.RedBlackTree
+
+
Traverses through the red black tree using the pre order traversal, and puts + values into an array list.
+
+
printList(ArrayList<RBNode<E>>) - Method in class rbtree.RedBlackTree
+
+
Prints an array list.
+
+
printNodeValue(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Prints the value in the node.
+
+
printTree() - Method in class rbtree.RedBlackTree
+
+
Prints the tree.
+
+
printTree(RBNode<E>, boolean, String) - Method in class rbtree.RedBlackTree
+
+
Prints the tree
+
+
+B C D F G I L M N P R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index-files/index-11.html b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-11.html new file mode 100644 index 0000000..050bd42 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-11.html @@ -0,0 +1,147 @@ + + + + + +R-Index + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G I L M N P R S U  + + +

R

+
+
RBNode<E extends java.lang.Comparable<E>> - Class in rbtree
+
 
+
RBNode(E) - Constructor for class rbtree.RBNode
+
+
Creates an RBNode.
+
+
rbtree - package rbtree
+
 
+
RedBlackTree<E extends java.lang.Comparable<E>> - Class in rbtree
+
 
+
RedBlackTree() - Constructor for class rbtree.RedBlackTree
+
 
+
RedBlackTree(E[]) - Constructor for class rbtree.RedBlackTree
+
 
+
right - Variable in class rbtree.RBNode
+
 
+
rightRotate(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Right rotates the tree to ensure red and black tree properties are fulfilled.
+
+
root - Variable in class rbtree.RedBlackTree
+
 
+
+B C D F G I L M N P R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index-files/index-12.html b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-12.html new file mode 100644 index 0000000..a0a5a4b --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-12.html @@ -0,0 +1,133 @@ + + + + + +S-Index + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G I L M N P R S U  + + +

S

+
+
setData(E) - Method in class rbtree.RBNode
+
+
A setter for the node.
+
+
sibling(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Finds the sibling of a node.
+
+
+B C D F G I L M N P R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index-files/index-13.html b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-13.html new file mode 100644 index 0000000..b21c0ca --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-13.html @@ -0,0 +1,129 @@ + + + + + +U-Index + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G I L M N P R S U  + + +

U

+
+
uncle(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Finds the uncle of a node.
+
+
+B C D F G I L M N P R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index-files/index-2.html b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-2.html new file mode 100644 index 0000000..31b14b2 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-2.html @@ -0,0 +1,127 @@ + + + + + +C-Index + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G I L M N P R S U  + + +

C

+
+
color - Variable in class rbtree.RBNode
+
 
+
+B C D F G I L M N P R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index-files/index-3.html b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-3.html new file mode 100644 index 0000000..06a50c7 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-3.html @@ -0,0 +1,135 @@ + + + + + +D-Index + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G I L M N P R S U  + + +

D

+
+
data - Variable in class rbtree.RBNode
+
 
+
delete(E) - Method in class rbtree.RedBlackTree
+
+
A helper method to delete a node.
+
+
delete(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Deletes the node.
+
+
+B C D F G I L M N P R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index-files/index-4.html b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-4.html new file mode 100644 index 0000000..83a9e12 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-4.html @@ -0,0 +1,129 @@ + + + + + +F-Index + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G I L M N P R S U  + + +

F

+
+
find(E) - Method in class rbtree.RedBlackTree
+
+
Finds if the data exists in red black tree based off of parameter.
+
+
+B C D F G I L M N P R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index-files/index-5.html b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-5.html new file mode 100644 index 0000000..de44945 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-5.html @@ -0,0 +1,133 @@ + + + + + +G-Index + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G I L M N P R S U  + + +

G

+
+
getData() - Method in class rbtree.RBNode
+
+
A getter for the value inside the node.
+
+
grandparent(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Finds the grandparent of a node.
+
+
+B C D F G I L M N P R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index-files/index-6.html b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-6.html new file mode 100644 index 0000000..0de055a --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-6.html @@ -0,0 +1,163 @@ + + + + + +I-Index + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G I L M N P R S U  + + +

I

+
+
inorder() - Method in class rbtree.RedBlackTree
+
+
A helper method for the in order traversal method.
+
+
inorder(RBNode<E>, ArrayList<RBNode<E>>) - Method in class rbtree.RedBlackTree
+
+
Traverses through the red black tree using the in order traversal, and puts + values into an array list.
+
+
insert(E) - Method in class rbtree.RedBlackTree
+
+
Inserts a node into the red and black tree.
+
+
insertCleanUp(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Implements the red and black tree properties, and ensures the tree be balanced correctly with + the correct color for each node.
+
+
insertionPoint(E) - Method in class rbtree.RedBlackTree
+
+
Finds the spot of the parent of the node we will be inserting into the tree.
+
+
isEmpty() - Method in class rbtree.RedBlackTree
+
+
Checks to see if a tree is empty or not.
+
+
isLeaf(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Checks to see if a node is a leaf.
+
+
isLeftChild(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Checks if a node is a left child.
+
+
isRightChild(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Checks if a node is a right child.
+
+
+B C D F G I L M N P R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index-files/index-7.html b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-7.html new file mode 100644 index 0000000..dddf4c4 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-7.html @@ -0,0 +1,131 @@ + + + + + +L-Index + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G I L M N P R S U  + + +

L

+
+
left - Variable in class rbtree.RBNode
+
 
+
leftRotate(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Left rotates the tree to ensure red and black tree properties are fulfilled.
+
+
+B C D F G I L M N P R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index-files/index-8.html b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-8.html new file mode 100644 index 0000000..b4167c1 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-8.html @@ -0,0 +1,129 @@ + + + + + +M-Index + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G I L M N P R S U  + + +

M

+
+
maxLeftSubtree(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Finds the max node in the left sub tree of a node.
+
+
+B C D F G I L M N P R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index-files/index-9.html b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-9.html new file mode 100644 index 0000000..b063b80 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index-files/index-9.html @@ -0,0 +1,135 @@ + + + + + +N-Index + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G I L M N P R S U  + + +

N

+
+
NIL - Variable in class rbtree.RedBlackTree
+
 
+
nodeToDelete(E) - Method in class rbtree.RedBlackTree
+
+
Finds the node that will be deleted.
+
+
numChildren(RBNode<E>) - Method in class rbtree.RedBlackTree
+
+
Counts the number of children of a node in the red black tree.
+
+
+B C D F G I L M N P R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/index.html b/Java/Red and Black Tree/doc/rbtree/private/index.html new file mode 100644 index 0000000..2a3c4e7 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/index.html @@ -0,0 +1,72 @@ + + + + + +Generated Documentation (Untitled) + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="rbtree/package-summary.html">Non-frame version</a>.</p> + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/overview-tree.html b/Java/Red and Black Tree/doc/rbtree/private/overview-tree.html new file mode 100644 index 0000000..2ec17d7 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/overview-tree.html @@ -0,0 +1,136 @@ + + + + + +Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/package-list b/Java/Red and Black Tree/doc/rbtree/private/package-list new file mode 100644 index 0000000..893ee01 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/package-list @@ -0,0 +1 @@ +rbtree diff --git a/Java/Red and Black Tree/doc/rbtree/private/rbtree/RBNode.html b/Java/Red and Black Tree/doc/rbtree/private/rbtree/RBNode.html new file mode 100644 index 0000000..1939410 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/rbtree/RBNode.html @@ -0,0 +1,395 @@ + + + + + +RBNode + + + + + + + + + + + + +
+
rbtree
+

Class RBNode<E extends java.lang.Comparable<E>>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • rbtree.RBNode<E>
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class RBNode<E extends java.lang.Comparable<E>>
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      protected java.lang.Stringcolor 
      protected Edata 
      protected RBNode<E>left 
      protected RBNode<E>parent 
      protected RBNode<E>right 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      RBNode(E data) +
      Creates an RBNode.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      EgetData() +
      A getter for the value inside the node.
      +
      voidsetData(E data) +
      A setter for the node.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        parent

        +
        protected RBNode<E extends java.lang.Comparable<E>> parent
        +
      • +
      + + + +
        +
      • +

        left

        +
        protected RBNode<E extends java.lang.Comparable<E>> left
        +
      • +
      + + + +
        +
      • +

        right

        +
        protected RBNode<E extends java.lang.Comparable<E>> right
        +
      • +
      + + + +
        +
      • +

        color

        +
        protected java.lang.String color
        +
      • +
      + + + +
        +
      • +

        data

        +
        protected E extends java.lang.Comparable<E> data
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + + + +
        +
      • +

        RBNode

        +
        public RBNode(E data)
        +
        Creates an RBNode.
        +
        +
        Parameters:
        +
        data - is the data that is stored in the given node.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        setData

        +
        public void setData(E data)
        +
        A setter for the node.
        +
        +
        Parameters:
        +
        data - is the value that will be set into the node.
        +
        +
      • +
      + + + +
        +
      • +

        getData

        +
        public E getData()
        +
        A getter for the value inside the node.
        +
        +
        Returns:
        +
        the data in the node.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/rbtree/RedBlackTree.html b/Java/Red and Black Tree/doc/rbtree/private/rbtree/RedBlackTree.html new file mode 100644 index 0000000..7e5d417 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/rbtree/RedBlackTree.html @@ -0,0 +1,981 @@ + + + + + +RedBlackTree + + + + + + + + + + + + +
+
rbtree
+

Class RedBlackTree<E extends java.lang.Comparable<E>>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • rbtree.RedBlackTree<E>
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class RedBlackTree<E extends java.lang.Comparable<E>>
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      private RBNode<E>NIL 
      private RBNode<E>root 
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.util.ArrayList<RBNode<E>>breadthfirst() +
      A helper method for the breadth first traversal method.
      +
      java.util.ArrayList<RBNode<E>>breadthfirst(RBNode<E> node) +
      Traverses through the red black tree using breadth first algorithm.
      +
      voiddelete(E key) +
      A helper method to delete a node.
      +
      voiddelete(RBNode<E> node) +
      Deletes the node.
      +
      booleanfind(E key) +
      Finds if the data exists in red black tree based off of parameter.
      +
      (package private) RBNode<E>grandparent(RBNode<E> node) +
      Finds the grandparent of a node.
      +
      java.util.ArrayList<RBNode<E>>inorder() +
      A helper method for the in order traversal method.
      +
      private java.util.ArrayList<RBNode<E>>inorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the in order traversal, and puts + values into an array list.
      +
      voidinsert(E key) +
      Inserts a node into the red and black tree.
      +
      private voidinsertCleanUp(RBNode<E> node) +
      Implements the red and black tree properties, and ensures the tree be balanced correctly with + the correct color for each node.
      +
      RBNode<E>insertionPoint(E key) +
      Finds the spot of the parent of the node we will be inserting into the tree.
      +
      booleanisEmpty() +
      Checks to see if a tree is empty or not.
      +
      booleanisLeaf(RBNode<E> node) +
      Checks to see if a node is a leaf.
      +
      booleanisLeftChild(RBNode<E> node) +
      Checks if a node is a left child.
      +
      booleanisRightChild(RBNode<E> node) +
      Checks if a node is a right child.
      +
      private voidleftRotate(RBNode<E> node) +
      Left rotates the tree to ensure red and black tree properties are fulfilled.
      +
      RBNode<E>maxLeftSubtree(RBNode<E> node) +
      Finds the max node in the left sub tree of a node.
      +
      RBNode<E>nodeToDelete(E key) +
      Finds the node that will be deleted.
      +
      intnumChildren(RBNode<E> node) +
      Counts the number of children of a node in the red black tree.
      +
      java.util.ArrayList<RBNode<E>>postorder() +
      A helper method for the post order traversal method.
      +
      private java.util.ArrayList<RBNode<E>>postorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the post order traversal, and puts + values into an array list.
      +
      java.util.ArrayList<RBNode<E>>preorder() +
      A helper method for the pre order traversal method.
      +
      java.util.ArrayList<RBNode<E>>preorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the pre order traversal, and puts + values into an array list.
      +
      voidprintList(java.util.ArrayList<RBNode<E>> myList) +
      Prints an array list.
      +
      private voidprintNodeValue(RBNode<E> node) +
      Prints the value in the node.
      +
      voidprintTree() +
      Prints the tree.
      +
      private voidprintTree(RBNode<E> node, + boolean isRight, + java.lang.String indent) +
      Prints the tree
      +
      private voidrightRotate(RBNode<E> node) +
      Right rotates the tree to ensure red and black tree properties are fulfilled.
      +
      (package private) RBNode<E>sibling(RBNode<E> node) +
      Finds the sibling of a node.
      +
      (package private) RBNode<E>uncle(RBNode<E> node) +
      Finds the uncle of a node.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        root

        +
        private RBNode<E extends java.lang.Comparable<E>> root
        +
      • +
      + + + +
        +
      • +

        NIL

        +
        private RBNode<E extends java.lang.Comparable<E>> NIL
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RedBlackTree

        +
        public RedBlackTree()
        +
      • +
      + + + + + +
        +
      • +

        RedBlackTree

        +
        public RedBlackTree(E[] myArray)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        insertionPoint

        +
        public RBNode<E> insertionPoint(E key)
        +
        Finds the spot of the parent of the node we will be inserting into the tree.
        +
        +
        Parameters:
        +
        key - is the data inside the node.
        +
        Returns:
        +
        the parent of the new node we are going to insert.
        +
        +
      • +
      + + + + + +
        +
      • +

        insert

        +
        public void insert(E key)
        +
        Inserts a node into the red and black tree.
        +
        +
        Parameters:
        +
        key - is the data which will be inside of the new node.
        +
        +
      • +
      + + + + + +
        +
      • +

        find

        +
        public boolean find(E key)
        +
        Finds if the data exists in red black tree based off of parameter.
        +
        +
        Parameters:
        +
        key - is the data being searched in the tree.
        +
        Returns:
        +
        true if key is found, and false if it is not found.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Checks to see if a tree is empty or not.
        +
        +
        Returns:
        +
        true if tree is empty. False if tree is not empty.
        +
        +
      • +
      + + + +
        +
      • +

        isLeaf

        +
        public boolean isLeaf(RBNode<E> node)
        +
        Checks to see if a node is a leaf.
        +
        +
        Parameters:
        +
        node - is the node we are checking.
        +
        Returns:
        +
        true if the node is a leaf, and false if it is not a leaf.
        +
        +
      • +
      + + + +
        +
      • +

        printTree

        +
        public void printTree()
        +
        Prints the tree.
        +
      • +
      + + + +
        +
      • +

        printTree

        +
        private void printTree(RBNode<E> node,
        +                       boolean isRight,
        +                       java.lang.String indent)
        +
        Prints the tree
        +
        +
        Parameters:
        +
        node - is the current node.
        +
        isRight - boolean for if it is right.
        +
        indent -
        +
        +
      • +
      + + + +
        +
      • +

        printNodeValue

        +
        private void printNodeValue(RBNode<E> node)
        +
        Prints the value in the node.
        +
        +
        Parameters:
        +
        node - the current node.
        +
        +
      • +
      + + + +
        +
      • +

        numChildren

        +
        public int numChildren(RBNode<E> node)
        +
        Counts the number of children of a node in the red black tree.
        +
        +
        Parameters:
        +
        node - is the node we are checking.
        +
        Returns:
        +
        the count of the number of children that the node has.
        +
        +
      • +
      + + + + + +
        +
      • +

        nodeToDelete

        +
        public RBNode<E> nodeToDelete(E key)
        +
        Finds the node that will be deleted.
        +
        +
        Parameters:
        +
        key - is the data inside that node.
        +
        Returns:
        +
        the node if it exists, and null if it does not.
        +
        +
      • +
      + + + + + +
        +
      • +

        delete

        +
        public void delete(E key)
        +
        A helper method to delete a node.
        +
        +
        Parameters:
        +
        key - is the value of the node that is going to be deleted.
        +
        +
      • +
      + + + +
        +
      • +

        delete

        +
        public void delete(RBNode<E> node)
        +
        Deletes the node.
        +
        +
        Parameters:
        +
        node - is the node that is going to be deleted.
        +
        +
      • +
      + + + +
        +
      • +

        maxLeftSubtree

        +
        public RBNode<E> maxLeftSubtree(RBNode<E> node)
        +
        Finds the max node in the left sub tree of a node.
        +
        +
        Parameters:
        +
        node - is the node we are checking.
        +
        Returns:
        +
        the max node in the left sub tree.
        +
        +
      • +
      + + + +
        +
      • +

        sibling

        +
        RBNode<E> sibling(RBNode<E> node)
        +
        Finds the sibling of a node.
        +
        +
        Parameters:
        +
        node - is the node that we are trying to find the sibling of.
        +
        Returns:
        +
        the sibling of a node.
        +
        +
      • +
      + + + +
        +
      • +

        uncle

        +
        RBNode<E> uncle(RBNode<E> node)
        +
        Finds the uncle of a node.
        +
        +
        Parameters:
        +
        node - is the node that we are trying to find the uncle of.
        +
        Returns:
        +
        the uncle of a node.
        +
        +
      • +
      + + + +
        +
      • +

        grandparent

        +
        RBNode<E> grandparent(RBNode<E> node)
        +
        Finds the grandparent of a node.
        +
        +
        Parameters:
        +
        node - is the node that we are trying to find the grandparent of.
        +
        Returns:
        +
        the grandparent of a node.
        +
        +
      • +
      + + + +
        +
      • +

        isLeftChild

        +
        public boolean isLeftChild(RBNode<E> node)
        +
        Checks if a node is a left child.
        +
        +
        Parameters:
        +
        node - is the node we are checking.
        +
        Returns:
        +
        true if the node is a left child, and false if it is not a left + child.
        +
        +
      • +
      + + + +
        +
      • +

        isRightChild

        +
        public boolean isRightChild(RBNode<E> node)
        +
        Checks if a node is a right child.
        +
        +
        Parameters:
        +
        node - is the node we are checking.
        +
        Returns:
        +
        true if the node is a right child, and false if it is not a right + child.
        +
        +
      • +
      + + + +
        +
      • +

        preorder

        +
        public java.util.ArrayList<RBNode<E>> preorder()
        +
        A helper method for the pre order traversal method.
        +
        +
        Returns:
        +
        an array list with the correct traversal.
        +
        +
      • +
      + + + +
        +
      • +

        preorder

        +
        public java.util.ArrayList<RBNode<E>> preorder(RBNode<E> node,
        +                                               java.util.ArrayList<RBNode<E>> myList)
        +
        Traverses through the red black tree using the pre order traversal, and puts + values into an array list.
        +
        +
        Parameters:
        +
        node - the node being sent into method.
        +
        myList - is the array list used to store nodes.
        +
        Returns:
        +
        the array list with the nodes in the appropriate order.
        +
        +
      • +
      + + + +
        +
      • +

        postorder

        +
        public java.util.ArrayList<RBNode<E>> postorder()
        +
        A helper method for the post order traversal method.
        +
        +
        Returns:
        +
        an array list with the correct traversal.
        +
        +
      • +
      + + + +
        +
      • +

        postorder

        +
        private java.util.ArrayList<RBNode<E>> postorder(RBNode<E> node,
        +                                                 java.util.ArrayList<RBNode<E>> myList)
        +
        Traverses through the red black tree using the post order traversal, and puts + values into an array list.
        +
        +
        Parameters:
        +
        node - the node being sent into method.
        +
        myList - is the array list used to store nodes.
        +
        Returns:
        +
        the array list with the nodes in the appropriate order.
        +
        +
      • +
      + + + +
        +
      • +

        inorder

        +
        public java.util.ArrayList<RBNode<E>> inorder()
        +
        A helper method for the in order traversal method.
        +
        +
        Returns:
        +
        an array list with the correct traversal.
        +
        +
      • +
      + + + +
        +
      • +

        inorder

        +
        private java.util.ArrayList<RBNode<E>> inorder(RBNode<E> node,
        +                                               java.util.ArrayList<RBNode<E>> myList)
        +
        Traverses through the red black tree using the in order traversal, and puts + values into an array list.
        +
        +
        Parameters:
        +
        node - the node being sent into method.
        +
        myList - is the array list used to store nodes.
        +
        Returns:
        +
        the array list with the nodes in the appropriate order.
        +
        +
      • +
      + + + +
        +
      • +

        breadthfirst

        +
        public java.util.ArrayList<RBNode<E>> breadthfirst()
        +
        A helper method for the breadth first traversal method.
        +
        +
        Returns:
        +
        an array list with the correct traversal.
        +
        +
      • +
      + + + +
        +
      • +

        breadthfirst

        +
        public java.util.ArrayList<RBNode<E>> breadthfirst(RBNode<E> node)
        +
        Traverses through the red black tree using breadth first algorithm. Inputs + into an array list accordingly.
        +
        +
        Parameters:
        +
        node - is the root of the red black tree.
        +
        Returns:
        +
        an array list of nodes.
        +
        +
      • +
      + + + +
        +
      • +

        printList

        +
        public void printList(java.util.ArrayList<RBNode<E>> myList)
        +
        Prints an array list.
        +
        +
        Parameters:
        +
        myList - the list of RBNode that is going to be printed.
        +
        +
      • +
      + + + +
        +
      • +

        insertCleanUp

        +
        private void insertCleanUp(RBNode<E> node)
        +
        Implements the red and black tree properties, and ensures the tree be balanced correctly with + the correct color for each node.
        +
        +
        Parameters:
        +
        node - is the node being inserted into the red and black tree.
        +
        +
      • +
      + + + +
        +
      • +

        leftRotate

        +
        private void leftRotate(RBNode<E> node)
        +
        Left rotates the tree to ensure red and black tree properties are fulfilled.
        +
        +
        Parameters:
        +
        node - is the node used as a pivot.
        +
        +
      • +
      + + + +
        +
      • +

        rightRotate

        +
        private void rightRotate(RBNode<E> node)
        +
        Right rotates the tree to ensure red and black tree properties are fulfilled.
        +
        +
        Parameters:
        +
        node - is the node used as a pivot.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/rbtree/RedBlackTree.zip b/Java/Red and Black Tree/doc/rbtree/private/rbtree/RedBlackTree.zip new file mode 100644 index 0000000000000000000000000000000000000000..f8b01887f8d79f7ac3b6d8e013137bd952d9e556 GIT binary patch literal 8204 zcmZ{pQ*qdzh^7SLO@~y003A3X=R37jJGt=(m(BN4FG`l*3iHMD%v9+p`sVTFCi>=LH zU0?f+vAM5a;hw=X7#-WbLh|AEQiVg2w44(i?iND^bxd(IrTvNhP;#}T#-bCioo`xD}5EBK@-)n)u~7G%?sWlQ&&70bsP86FccrWY z@Avvym5|SiahYiC*+R{&uyk24)oRpg*gflP`QZ9gh2ccYmn6|S9@zJB6L~*QVx)zf zq~KhTg8yfUyN{2QPWT6rRk&>Y!%mXlb@B7y_=fx8laJh6o%i(+X&~0>!$VxAc?;Vo z?-T9k?2)Nbdw$>#LgODWnQ)?(Cg;3hu0eren7noIe4ni`Y#UBJ=<(|ie^8b=A5T)C z@!^(bPw{5$f4HB&<7argaL&4P6MUc7gd%Xr-!f(^I#Cp`#w&+(2$Kyc{&eHudr3ZW z4?uhro(b;Lo)aQU>JM=73b*qA(8ebolZDx;#`YjHtDMmGCUJdD)sI5K_2L!E&&5d! zjj~IpyPCU!EjPc)6vRu=|8@a%oA>rD))cs1!^yKBI%##_D9d60H2qvnG;v#uxtL5Qyz)w$Q-V&+Ex_5o2i}VDw{^TrcRaY672~i>+3C znLmWsj&ruQAR80Od&Vi`^3?e9-naW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Eq(H93cRq=C+fn3$o<>{%#hSRX9N>Qur?LlZU&yuMMHf9Ed0+ zlzkp$1Pb>;{86>-v_C20sk^_0lc!RESlB#6C)Lua_xMx z69DR?V#4&q#M~x{@hJ=DWM8A@1w?TzoA+a6{K>=z)g(n9$R8bZtsY}RrFr2DsW^}g zZiBt%en8nHiRnk$1*10xtzVYqY2G@|5LN=OVfSP6#0h&E73~vOMW_MJRCZk6rmwB8Z0!1K4>G)zIs=}+V zMNSjWS*1iUBtEcy-R;pq8VYh8Mo7lUVdGHWnJ}=GIGinRz+V)FR#$zOTMT20TKBg% z?B(v>%lJo-kf0d9@+ctOB2YBL>@w^NI=CXp%CMDOrrI^>*U#C_g|duN@cB6dj;y2?{Z2$JZ;OsB)2VR= z_NfX1{qN|?u3xo>1=A?o#mW>&!oJ$_cx-15 zuW4#2LZ3V7=3ju7=r%^$IF2hE&KF|fYixHIlL|X9Da5qc{zFxbk@snPX3By=+FFU)$X5X>D_|gwg~>J z(C(k4u(P!?U=Qw)vKQ&L2Ia_s4v4>j07|l8;Fy5_|NQ+Q`w0L8kp5f#S^w8G{(qPM hzpU%OqW{PtvHlMut0W5r{qH6CKilJ<>PPZ#_g^oC=)V8} literal 0 HcmV?d00001 diff --git a/Java/Red and Black Tree/doc/rbtree/private/rbtree/class-use/RBNode.html b/Java/Red and Black Tree/doc/rbtree/private/rbtree/class-use/RBNode.html new file mode 100644 index 0000000..76632cb --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/rbtree/class-use/RBNode.html @@ -0,0 +1,436 @@ + + + + + +Uses of Class rbtree.RBNode + + + + + + + + + + + +
+

Uses of Class
rbtree.RBNode

+
+
+
    +
  • +
      +
    • + + +

      Uses of RBNode in rbtree

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields in rbtree declared as RBNode 
      Modifier and TypeField and Description
      protected RBNode<E>RBNode.left 
      private RBNode<E>RedBlackTree.NIL 
      protected RBNode<E>RBNode.parent 
      protected RBNode<E>RBNode.right 
      private RBNode<E>RedBlackTree.root 
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in rbtree that return RBNode 
      Modifier and TypeMethod and Description
      (package private) RBNode<E>RedBlackTree.grandparent(RBNode<E> node) +
      Finds the grandparent of a node.
      +
      RBNode<E>RedBlackTree.insertionPoint(E key) +
      Finds the spot of the parent of the node we will be inserting into the tree.
      +
      RBNode<E>RedBlackTree.maxLeftSubtree(RBNode<E> node) +
      Finds the max node in the left sub tree of a node.
      +
      RBNode<E>RedBlackTree.nodeToDelete(E key) +
      Finds the node that will be deleted.
      +
      (package private) RBNode<E>RedBlackTree.sibling(RBNode<E> node) +
      Finds the sibling of a node.
      +
      (package private) RBNode<E>RedBlackTree.uncle(RBNode<E> node) +
      Finds the uncle of a node.
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in rbtree that return types with arguments of type RBNode 
      Modifier and TypeMethod and Description
      java.util.ArrayList<RBNode<E>>RedBlackTree.breadthfirst() +
      A helper method for the breadth first traversal method.
      +
      java.util.ArrayList<RBNode<E>>RedBlackTree.breadthfirst(RBNode<E> node) +
      Traverses through the red black tree using breadth first algorithm.
      +
      java.util.ArrayList<RBNode<E>>RedBlackTree.inorder() +
      A helper method for the in order traversal method.
      +
      private java.util.ArrayList<RBNode<E>>RedBlackTree.inorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the in order traversal, and puts + values into an array list.
      +
      java.util.ArrayList<RBNode<E>>RedBlackTree.postorder() +
      A helper method for the post order traversal method.
      +
      private java.util.ArrayList<RBNode<E>>RedBlackTree.postorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the post order traversal, and puts + values into an array list.
      +
      java.util.ArrayList<RBNode<E>>RedBlackTree.preorder() +
      A helper method for the pre order traversal method.
      +
      java.util.ArrayList<RBNode<E>>RedBlackTree.preorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the pre order traversal, and puts + values into an array list.
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in rbtree with parameters of type RBNode 
      Modifier and TypeMethod and Description
      java.util.ArrayList<RBNode<E>>RedBlackTree.breadthfirst(RBNode<E> node) +
      Traverses through the red black tree using breadth first algorithm.
      +
      voidRedBlackTree.delete(RBNode<E> node) +
      Deletes the node.
      +
      (package private) RBNode<E>RedBlackTree.grandparent(RBNode<E> node) +
      Finds the grandparent of a node.
      +
      private java.util.ArrayList<RBNode<E>>RedBlackTree.inorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the in order traversal, and puts + values into an array list.
      +
      private voidRedBlackTree.insertCleanUp(RBNode<E> node) +
      Implements the red and black tree properties, and ensures the tree be balanced correctly with + the correct color for each node.
      +
      booleanRedBlackTree.isLeaf(RBNode<E> node) +
      Checks to see if a node is a leaf.
      +
      booleanRedBlackTree.isLeftChild(RBNode<E> node) +
      Checks if a node is a left child.
      +
      booleanRedBlackTree.isRightChild(RBNode<E> node) +
      Checks if a node is a right child.
      +
      private voidRedBlackTree.leftRotate(RBNode<E> node) +
      Left rotates the tree to ensure red and black tree properties are fulfilled.
      +
      RBNode<E>RedBlackTree.maxLeftSubtree(RBNode<E> node) +
      Finds the max node in the left sub tree of a node.
      +
      intRedBlackTree.numChildren(RBNode<E> node) +
      Counts the number of children of a node in the red black tree.
      +
      private java.util.ArrayList<RBNode<E>>RedBlackTree.postorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the post order traversal, and puts + values into an array list.
      +
      java.util.ArrayList<RBNode<E>>RedBlackTree.preorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the pre order traversal, and puts + values into an array list.
      +
      private voidRedBlackTree.printNodeValue(RBNode<E> node) +
      Prints the value in the node.
      +
      private voidRedBlackTree.printTree(RBNode<E> node, + boolean isRight, + java.lang.String indent) +
      Prints the tree
      +
      private voidRedBlackTree.rightRotate(RBNode<E> node) +
      Right rotates the tree to ensure red and black tree properties are fulfilled.
      +
      (package private) RBNode<E>RedBlackTree.sibling(RBNode<E> node) +
      Finds the sibling of a node.
      +
      (package private) RBNode<E>RedBlackTree.uncle(RBNode<E> node) +
      Finds the uncle of a node.
      +
      + + + + + + + + + + + + + + + + + + + + + + + + +
      Method parameters in rbtree with type arguments of type RBNode 
      Modifier and TypeMethod and Description
      private java.util.ArrayList<RBNode<E>>RedBlackTree.inorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the in order traversal, and puts + values into an array list.
      +
      private java.util.ArrayList<RBNode<E>>RedBlackTree.postorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the post order traversal, and puts + values into an array list.
      +
      java.util.ArrayList<RBNode<E>>RedBlackTree.preorder(RBNode<E> node, + java.util.ArrayList<RBNode<E>> myList) +
      Traverses through the red black tree using the pre order traversal, and puts + values into an array list.
      +
      voidRedBlackTree.printList(java.util.ArrayList<RBNode<E>> myList) +
      Prints an array list.
      +
      +
    • +
    +
  • +
+
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/rbtree/class-use/RedBlackTree.html b/Java/Red and Black Tree/doc/rbtree/private/rbtree/class-use/RedBlackTree.html new file mode 100644 index 0000000..13ca9e5 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/rbtree/class-use/RedBlackTree.html @@ -0,0 +1,122 @@ + + + + + +Uses of Class rbtree.RedBlackTree + + + + + + + + + + + +
+

Uses of Class
rbtree.RedBlackTree

+
+
No usage of rbtree.RedBlackTree
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/rbtree/package-frame.html b/Java/Red and Black Tree/doc/rbtree/private/rbtree/package-frame.html new file mode 100644 index 0000000..ae502fc --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/rbtree/package-frame.html @@ -0,0 +1,21 @@ + + + + + +rbtree + + + + + +

rbtree

+
+

Classes

+ +
+ + diff --git a/Java/Red and Black Tree/doc/rbtree/private/rbtree/package-summary.html b/Java/Red and Black Tree/doc/rbtree/private/rbtree/package-summary.html new file mode 100644 index 0000000..8839a85 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/rbtree/package-summary.html @@ -0,0 +1,144 @@ + + + + + +rbtree + + + + + + + + + + + +
+

Package rbtree

+
+
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    RBNode<E extends java.lang.Comparable<E>> 
    RedBlackTree<E extends java.lang.Comparable<E>> 
    +
  • +
+
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/rbtree/package-tree.html b/Java/Red and Black Tree/doc/rbtree/private/rbtree/package-tree.html new file mode 100644 index 0000000..56be0b0 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/rbtree/package-tree.html @@ -0,0 +1,132 @@ + + + + + +rbtree Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package rbtree

+
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/rbtree/package-use.html b/Java/Red and Black Tree/doc/rbtree/private/rbtree/package-use.html new file mode 100644 index 0000000..d963d56 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/rbtree/package-use.html @@ -0,0 +1,140 @@ + + + + + +Uses of Package rbtree + + + + + + + + + + + +
+

Uses of Package
rbtree

+
+
+ +
+ + + + + + diff --git a/Java/Red and Black Tree/doc/rbtree/private/script.js b/Java/Red and Black Tree/doc/rbtree/private/script.js new file mode 100644 index 0000000..b346356 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/Java/Red and Black Tree/doc/rbtree/private/stylesheet.css b/Java/Red and Black Tree/doc/rbtree/private/stylesheet.css new file mode 100644 index 0000000..98055b2 --- /dev/null +++ b/Java/Red and Black Tree/doc/rbtree/private/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/Java/Red and Black Tree/doc/script.js b/Java/Red and Black Tree/doc/script.js new file mode 100644 index 0000000..b346356 --- /dev/null +++ b/Java/Red and Black Tree/doc/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/Java/Red and Black Tree/doc/stylesheet.css b/Java/Red and Black Tree/doc/stylesheet.css new file mode 100644 index 0000000..98055b2 --- /dev/null +++ b/Java/Red and Black Tree/doc/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/Java/Red and Black Tree/src/.classpath b/Java/Red and Black Tree/src/.classpath new file mode 100644 index 0000000..3b2e843 --- /dev/null +++ b/Java/Red and Black Tree/src/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Java/Red and Black Tree/src/application/application.css b/Java/Red and Black Tree/src/application/application.css new file mode 100644 index 0000000..83d6f33 --- /dev/null +++ b/Java/Red and Black Tree/src/application/application.css @@ -0,0 +1 @@ +/* JavaFX CSS - Leave this comment until you have at least create one rule which uses -fx-Property */ \ No newline at end of file diff --git a/Java/Red and Black Tree/src/rbtree/Main.java b/Java/Red and Black Tree/src/rbtree/Main.java new file mode 100644 index 0000000..b892280 --- /dev/null +++ b/Java/Red and Black Tree/src/rbtree/Main.java @@ -0,0 +1,64 @@ +package rbtree; + +import javafx.application.Application; +import javafx.stage.Stage; +import rbtree.RedBlackTree; +import javafx.scene.Scene; +import javafx.scene.layout.BorderPane; + +public class Main extends Application { + @Override + public void start(Stage primaryStage) { + try { + BorderPane root = new BorderPane(); + Scene scene = new Scene(root, 400, 400); + scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm()); + primaryStage.setScene(scene); + primaryStage.show(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static void main(String[] args) { + // launch(args); + + + //TEST1 + Integer[] myArray1 = { 53,90,92,62,75,38,70,36,52,32 }; + RedBlackTree one = new RedBlackTree<>(myArray1); + System.out.println("Tree One : "); + System.out.println(); + one.printTree(); + System.out.println(); + + /* + //TEST2 + System.out.println(); + Integer[] myArray2 = { 10, 20, -10, 15, 17, 40,50,60 }; + RedBlackTree two = new RedBlackTree<>(myArray2); + System.out.println("Tree Two : "); + System.out.println(); + two.printTree(); + System.out.println(); + + //TEST3 + System.out.println(); + Integer[] myArray3 = { 4, 5, 1,3,2 }; + RedBlackTree three = new RedBlackTree<>(myArray3); + System.out.println("Tree Three : "); + System.out.println(); + three.printTree(); + System.out.println(); + + + //TEST4 + System.out.println(); + Integer[] myArray4 = { 1,2,3,4,5}; + RedBlackTree four = new RedBlackTree<>(myArray4); + System.out.println("Tree Four : "); + System.out.println(); + four.printTree(); + System.out.println();*/ + } +} diff --git a/Java/Red and Black Tree/src/rbtree/RBNode.java b/Java/Red and Black Tree/src/rbtree/RBNode.java new file mode 100644 index 0000000..83664c0 --- /dev/null +++ b/Java/Red and Black Tree/src/rbtree/RBNode.java @@ -0,0 +1,36 @@ +package rbtree; + +public class RBNode> { + + protected RBNode parent; + protected RBNode left; + protected RBNode right; + + protected String color;//B is black, DB is double black, R is red. + + protected E data; + + /** + * Creates an RBNode. + * @param data is the data that is stored in the given node. + */ + + public RBNode(E data) { + this.data = data; + } + + /** + * A setter for the node. + * @param data is the value that will be set into the node. + */ + public void setData(E data) { + this.data=data; + } + /** + * A getter for the value inside the node. + * @return the data in the node. + */ + public E getData() { + return this.data; + } +} diff --git a/Java/Red and Black Tree/src/rbtree/RedBlackTree.java b/Java/Red and Black Tree/src/rbtree/RedBlackTree.java new file mode 100644 index 0000000..6c6f4fd --- /dev/null +++ b/Java/Red and Black Tree/src/rbtree/RedBlackTree.java @@ -0,0 +1,886 @@ +package rbtree; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.Queue; + +//import tree.BSTNode; + +//import tree.RBNode; + +public class RedBlackTree> { + + private RBNode root; + private RBNode NIL; + + public RedBlackTree() { + this.root = null; + } + + public RedBlackTree(E[] myArray) { + + this.root = new RBNode(myArray[0]); + insertCleanUp(root); + RBNode current = root; + RBNode temp = current; + + for (int i = 0; i < myArray.length; i++) { + + if (i == 0) { + current.data = myArray[i]; + current.parent = null; + } + + else { + insert(myArray[i]); + } + + } + } + + /** + * Finds the spot of the parent of the node we will be inserting into the tree. + * + * @param key + * is the data inside the node. + * @return the parent of the new node we are going to insert. + */ + public RBNode insertionPoint(E key) { + + RBNode current = root; + + RBNode parent = null; + + RBNode temp = current; + + while (current != null) { + if (key.compareTo(current.data) == 0) { // throw + // DuplicateItemException + } + + else if (key.compareTo(current.data) < 0) { + + // key 0) { + + // key>current.data + + parent = current; + current = current.right; + + } + + } + + return parent; + + } + + /** + * Inserts a node into the red and black tree. + * + * @param key + * is the data which will be inside of the new node. + */ + + public void insert(E key) { + + RBNode child = new RBNode(key); + child.left = NIL; + child.right = NIL; + + if (root == null) { + insertCleanUp(child); + root = child; + } else { + + if (!find(key)) { + + child.parent = insertionPoint(key); + + if (key.compareTo(child.parent.data) < 0) { + child.parent.left = child; + } else if (key.compareTo(child.parent.data) > 0) { + child.parent.right = child; + } + + } + insertCleanUp(child); + } + } + + /** + * Finds if the data exists in red black tree based off of parameter. + * + * @param key + * is the data being searched in the tree. + * @return true if key is found, and false if it is not found. + */ + + public boolean find(E key) { + + RBNode current = this.root; + + while (current != null) { + + if (key.compareTo(current.data) == 0) { + return true; + } + + else if (key.compareTo(current.data) < 0) { + + current = current.left; + } + + else if (key.compareTo(current.data) > 0) { + + current = current.right; + } + + // System.out.println(current); + } + + return false; + } + + /** + * Checks to see if a tree is empty or not. + * + * @return true if tree is empty. False if tree is not empty. + */ + public boolean isEmpty() { + if (root == null) { + return true; + } + return false; + } + + /** + * Checks to see if a node is a leaf. + * + * @param node + * is the node we are checking. + * @return true if the node is a leaf, and false if it is not a leaf. + */ + + public boolean isLeaf(RBNode node) { + + if (node.right == null && node.left == null) { + return true; + } + + return false; + } + + /** + * Prints the tree. + */ + public void printTree() { + + if (this.root.right != null) { + this.printTree(this.root.right, true, ""); + } + + printNodeValue(this.root); + + if (this.root.left != null) { + this.printTree(this.root.left, false, ""); + } + } + + /** + * Prints the tree + * + * @param node + * is the current node. + * @param isRight + * boolean for if it is right. + * @param indent + */ + private void printTree(RBNode node, boolean isRight, String indent) { + if (node.right != null) { + printTree(node.right, true, indent + (isRight ? " " : " | ")); + } + + System.out.print(indent); + + if (isRight) { + System.out.print(" /"); + } else { + System.out.print(" \\"); + } + System.out.print("----- "); + printNodeValue(node); + if (node.left != null) { + printTree(node.left, false, indent + (isRight ? " | " : " ")); + } + + } + + /** + * Prints the value in the node. + * + * @param node + * the current node. + */ + + private void printNodeValue(RBNode node) { + if (node == null) { + System.out.print(""); + } else { + System.out.print(node.getData() + "(" + node.color + ")"); + } + + System.out.println(); + } + + /** + * Counts the number of children of a node in the red black tree. + * + * @param node + * is the node we are checking. + * @return the count of the number of children that the node has. + */ + + public int numChildren(RBNode node) { + int count = 0; + + if (node.left != null) { + count++; + } + if (node.right != null) { + count++; + } + return count; + + } + + /** + * Finds the node that will be deleted. + * + * @param key + * is the data inside that node. + * @return the node if it exists, and null if it does not. + */ + public RBNode nodeToDelete(E key) { + + if (find(key)) { + RBNode current = root; + + while (current != null) { + + if (key.compareTo(current.data) == 0) { + + return current; + } else if (key.compareTo(current.data) < 0) { + + current = current.left; + } else if (key.compareTo(current.data) > 0) { + current = current.right; + } + + } + } + return null; + } + + /** + * A helper method to delete a node. + * + * @param key + * is the value of the node that is going to be deleted. + */ + public void delete(E key) { + + if (find(key)) { + RBNode removing = nodeToDelete(key); + delete(removing); + } + } + + /** + * Deletes the node. + * + * @param node + * is the node that is going to be deleted. + */ + + public void delete(RBNode node) { + + RBNode child = null; + + if (isLeaf(node)) { + if (isLeftChild(node)) { + node.parent.left = null; + + } else if (isRightChild(node)) { + node.parent.right = null; + + } + } else if (numChildren(node) == 1) { + + if (node.left == null) { + child = node.right; + } else if (node.right == null) { + child = node.left; + } + + if (isLeftChild(node)) { + node.parent.left = child; + child.parent = node.parent; + } else if (isRightChild(node)) { + node.parent.right = child; + child.parent = node.parent; + } + + } + + else if (numChildren(node) == 2) { + + RBNode max = maxLeftSubtree(node); + + node.setData(max.getData()); + delete(max); + + } + + } + + /** + * Finds the max node in the left sub tree of a node. + * + * @param node + * is the node we are checking. + * @return the max node in the left sub tree. + */ + public RBNode maxLeftSubtree(RBNode node) { + + RBNode current = node.left; + + if (current != null) { + while (current.right != null) { + current = current.right; + } + + return current; + + } + + return current; + } + + /** + * Finds the sibling of a node. + * + * @param node + * is the node that we are trying to find the sibling of. + * @return the sibling of a node. + */ + RBNode sibling(RBNode node) { + + if (find(node.getData())) { + + if (isRightChild(node) && node.parent.left != null) { + return node.parent.left; + } + + else if (isLeftChild(node) && node.parent.right != null) { + return node.parent.right; + } + } + return null; + } + + /** + * Finds the uncle of a node. + * + * @param node + * is the node that we are trying to find the uncle of. + * @return the uncle of a node. + */ + RBNode uncle(RBNode node) { + + if (node.parent != null) { + return sibling(node.parent); + } + + return null; + } + + /** + * Finds the grandparent of a node. + * + * @param node + * is the node that we are trying to find the grandparent of. + * @return the grandparent of a node. + */ + RBNode grandparent(RBNode node) { + + if (node.parent != null && (isLeftChild(node.parent) || isRightChild(node.parent))) { + + return node.parent.parent; + + } + + return null; + } + + /** + * Checks if a node is a left child. + * + * @param node + * is the node we are checking. + * @return true if the node is a left child, and false if it is not a left + * child. + */ + + public boolean isLeftChild(RBNode node) { + + if (node.parent == null) { + return false; + } else if (node.parent.left == null) { + return false; + } + + return node.parent.left.data.equals(node.data); + } + + /** + * Checks if a node is a right child. + * + * @param node + * is the node we are checking. + * @return true if the node is a right child, and false if it is not a right + * child. + */ + + public boolean isRightChild(RBNode node) { + + if (node.parent == null) { + return false; + } + + else if (node.parent.right == null) { + return false; + } + + return node.parent.right.data.equals(node.data); + } + + /** + * A helper method for the pre order traversal method. + * + * @return an array list with the correct traversal. + */ + + public ArrayList> preorder() { + ArrayList> myList = new ArrayList<>(); + + myList = preorder(root, myList); + return myList; + } + + /** + * Traverses through the red black tree using the pre order traversal, and puts + * values into an array list. + * + * @param node + * the node being sent into method. + * @param myList + * is the array list used to store nodes. + * @return the array list with the nodes in the appropriate order. + */ + + public ArrayList> preorder(RBNode node, ArrayList> myList) { + + if (node == null) { + return myList; + } + + myList.add(node); + + preorder(node.left, myList); + preorder(node.right, myList); + + return myList; + + } + + /** + * A helper method for the post order traversal method. + * + * @return an array list with the correct traversal. + */ + + public ArrayList> postorder() { + ArrayList> myList = new ArrayList<>(); + + myList = postorder(root, myList); + return myList; + } + + /** + * Traverses through the red black tree using the post order traversal, and puts + * values into an array list. + * + * @param node + * the node being sent into method. + * @param myList + * is the array list used to store nodes. + * @return the array list with the nodes in the appropriate order. + */ + + private ArrayList> postorder(RBNode node, ArrayList> myList) { + + if (node == null) { + return myList; + } + + postorder(node.left, myList); + postorder(node.right, myList); + // System.out.println(node.getData()); + + myList.add(node); + + return myList; + } + + /** + * A helper method for the in order traversal method. + * + * @return an array list with the correct traversal. + */ + + public ArrayList> inorder() { + ArrayList> myList = new ArrayList<>(); + + myList = inorder(this.root, myList); + return myList; + } + + /** + * Traverses through the red black tree using the in order traversal, and puts + * values into an array list. + * + * @param node + * the node being sent into method. + * @param myList + * is the array list used to store nodes. + * @return the array list with the nodes in the appropriate order. + */ + + private ArrayList> inorder(RBNode node, ArrayList> myList) { + + if (node == null) { + return myList; + } + + inorder(node.left, myList); + + myList.add(node); + // System.out.println(node.getData() + " size " + myList.size()); + + inorder(node.right, myList); + ; + return myList; + } + + /** + * A helper method for the breadth first traversal method. + * + * @return an array list with the correct traversal. + */ + + public ArrayList> breadthfirst() { + + ArrayList> myList = new ArrayList<>(); + + myList = breadthfirst(root); + return myList; + } + + /** + * Traverses through the red black tree using breadth first algorithm. Inputs + * into an array list accordingly. + * + * @param node + * is the root of the red black tree. + * @return an array list of nodes. + */ + + public ArrayList> breadthfirst(RBNode node) { + + ArrayList> myList = new ArrayList<>(); + Queue> Q = new LinkedList>(); + + Q.add(root); + + while (!Q.isEmpty()) { + node = Q.remove(); + myList.add(node); + System.out.println("data : " + node.getData()); + + if (node.left != null) { + Q.add(node.left); + } + if (node.right != null) { + Q.add(node.right); + } + } + + return myList; + } + + /** + * Prints an array list. + * + * @param myList + * the list of RBNode that is going to be printed. + */ + + public void printList(ArrayList> myList) { + + for (int i = 0; i < myList.size(); i++) { + + System.out.print(" [ " + myList.get(i).getData() + " ]"); + } + + } + + /** + * Implements the red and black tree properties, and ensures the tree be balanced correctly with + * the correct color for each node. + * @param node is the node being inserted into the red and black tree. + */ + + private void insertCleanUp(RBNode node) { + + // case 1: + if (node == root) { + node.color = "Black"; + return; + } else { + node.color = "Red"; + } + + // case 2: + + if (node.parent.color == "Black") { + return; + } + + // case 3: + + if (node.parent.color == "Red" && uncle(node) != null) { + + if (uncle(node).color == "Red") { + + node.parent.color = "Black"; + uncle(node).color = "Black"; + grandparent(node).color = "Red"; + insertCleanUp(grandparent(node)); + } + } + + // case 4: + + if (node.parent.color == "Red" && (uncle(node) == null || uncle(node).color == "Black")) { + if (isRightChild(node) && isLeftChild(node.parent)) { // case 4ab + + RBNode temp = node; + RBNode tempParent = node.parent; + + leftRotate(node); + + node = tempParent; + node.parent = temp; + + } + if (isLeftChild(node) && isRightChild(node.parent)) { + + RBNode temp = node; + RBNode tempParent = node.parent; + + rightRotate(node); + + node = tempParent; + node.parent = temp; + + } + } + + // case 5 : + if (node.parent.color == "Red" && (uncle(node) == null || uncle(node).color == "Black")) { + + if (isLeftChild(node) && isLeftChild(node.parent)) {// case 5ab + + grandparent(node).color = "Red"; + node.parent.color = "Black"; + + RBNode temp = node; + rightRotate(node); + + node = node.parent; + + } + if (isRightChild(node) && isRightChild(node.parent)) { + + grandparent(node).color = "Red"; + node.parent.color = "Black"; + + leftRotate(node); + } + } + + } + + /** + * Left rotates the tree to ensure red and black tree properties are fulfilled. + * @param node is the node used as a pivot. + */ + + private void leftRotate(RBNode node) { + + RBNode temp = node; + RBNode tempParent = node.parent; + RBNode tempGrandParent = grandparent(node); + + RBNode tempLeft = tempParent.left; + + if (node.parent.parent == null) { + + root = temp; + tempParent.right = null; + root.left = tempParent; + + node.parent = null; + root.left.parent = node; + + } + + else if (tempGrandParent.parent == null) { + + root = tempParent; + tempGrandParent.right = null; + root.left = tempGrandParent; + + node.parent.parent.parent = node.parent; + node.parent.parent = null; + + if (tempLeft != null) { + tempLeft.parent = node.parent.left; + node.parent.left.right = tempLeft; + } + + } + + else if (isLeftChild(tempParent) && isRightChild(temp)) { + + grandparent(node).left = temp; + tempParent.right = null; + node.left = tempParent; + + node.parent = tempGrandParent; + node.left.parent = temp; + + } else if (isRightChild(tempParent) && isRightChild(temp)) { + + if (isLeftChild(grandparent(node))) { + grandparent(node).parent.left = node.parent; + } else { + grandparent(node).parent.right = node.parent; + + } + + tempGrandParent.right = null; + + node.parent.left = tempGrandParent; + + node.parent.parent = tempGrandParent.parent; + sibling(node).parent = node.parent; + + if (tempLeft != null) { + tempLeft.parent = node.parent.left; + node.parent.left.right = tempLeft; + } + } + } + + /** + * Right rotates the tree to ensure red and black tree properties are fulfilled. + * @param node is the node used as a pivot. + */ + private void rightRotate(RBNode node) { + + RBNode temp = node; + RBNode tempParent = node.parent; + RBNode tempGrandParent = grandparent(node); + + RBNode tempRight = tempParent.right; + + if (node.parent.parent == null) { + + root = temp; + tempParent.left = null; + root.right = tempParent; + + node.parent = null; + root.right.parent = node; + + } else if (tempGrandParent.parent == null) { + + root = tempParent; + tempGrandParent.left = null; + root.right = tempGrandParent; + + node.parent.parent.parent = node.parent; + + node.parent.parent = null; + + if (tempRight != null) { + tempRight.parent = node.parent.right; + node.parent.right.left = tempRight; + } + } + + else if (isRightChild(tempParent) && isLeftChild(temp)) { + + grandparent(node).right = temp; + tempParent.left = null; + node.right = tempParent; + node.parent = tempGrandParent; + + node.right.parent = temp; + + } + + else if (isLeftChild(tempParent) && isLeftChild(temp)) { + + if (isLeftChild(grandparent(node))) { + grandparent(node).parent.left = node.parent; + } else { + grandparent(node).parent.right = node.parent; + + } + + tempGrandParent.left = null; + node.parent.right = tempGrandParent; + + node.parent.parent = tempGrandParent.parent; + sibling(node).parent = node.parent; + + if (tempRight != null) { + tempRight.parent = node.parent.right; + node.parent.right.left = tempRight; + } + + } + + } +} \ No newline at end of file