Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
R
RedBlackTree
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AJ-9
RedBlackTree
Commits
0598a173
Commit
0598a173
authored
Sep 05, 2024
by
Kair
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RedBlackTree
parent
bee0dd95
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
7 deletions
+3
-7
Main.java
Console/src/Main.java
+2
-2
Node.java
Console/src/Node.java
+0
-4
RBTree.java
Console/src/RBTree.java
+1
-1
No files found.
Console/src/Main.java
View file @
0598a173
...
...
@@ -57,7 +57,7 @@ public class Main {
}
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
root
.
getData
()
+
root
.
getColor
().
toString
());
sb
.
append
(
root
.
getData
()
).
append
(
root
.
getColor
().
toString
());
String
pointerRight
=
"└──"
;
String
pointerLeft
=
(
root
.
getRight
()
!=
null
)
?
"├──"
:
"└──"
;
...
...
@@ -74,7 +74,7 @@ public class Main {
sb
.
append
(
"\n"
);
sb
.
append
(
padding
);
sb
.
append
(
pointer
);
sb
.
append
(
node
.
getData
()
+
node
.
getColor
().
toString
());
sb
.
append
(
node
.
getData
()
).
append
(
node
.
getColor
().
toString
());
StringBuilder
paddingBuilder
=
new
StringBuilder
(
padding
);
if
(
hasRightSibling
)
{
...
...
Console/src/Node.java
View file @
0598a173
...
...
@@ -20,10 +20,6 @@ public class Node {
return
color
;
}
public
void
setData
(
int
data
)
{
this
.
data
=
data
;
}
public
Node
getLeft
()
{
return
left
;
}
...
...
Console/src/RBTree.java
View file @
0598a173
public
class
RBTree
{
private
static
final
NodeRB
EMPTY
=
new
NodeRB
(
0
);
;
private
static
final
NodeRB
EMPTY
=
new
NodeRB
(
0
);
static
{
EMPTY
.
leftNodeRB
=
EMPTY
;
EMPTY
.
rightNodeRB
=
EMPTY
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment