Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
yjs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sweng-group-15
yjs
Commits
7b52111c
Commit
7b52111c
authored
9 years ago
by
Kevin Jahns
Browse files
Options
Downloads
Patches
Plain Diff
fixed insertion bug in RBTree. adding does now work correctly
parent
c184cb96
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/OperationStores/RedBlackTree.js
+2
-0
2 additions, 0 deletions
src/OperationStores/RedBlackTree.js
src/OperationStores/RedBlackTree.spec.js
+2
-2
2 additions, 2 deletions
src/OperationStores/RedBlackTree.spec.js
y.js
+1
-1
1 addition, 1 deletion
y.js
y.js.map
+1
-1
1 addition, 1 deletion
y.js.map
with
6 additions
and
4 deletions
src/OperationStores/RedBlackTree.js
+
2
−
0
View file @
7b52111c
...
...
@@ -49,6 +49,7 @@ class N {
this
.
right
=
newRight
;
if
(
parent
==
null
)
{
tree
.
root
=
newParent
;
newParent
.
_parent
=
null
;
}
else
if
(
parent
.
left
===
this
)
{
parent
.
left
=
newParent
;
}
else
if
(
parent
.
right
===
this
)
{
...
...
@@ -65,6 +66,7 @@ class N {
this
.
left
=
newLeft
;
if
(
parent
==
null
)
{
tree
.
root
=
newParent
;
newParent
.
_parent
=
null
;
}
else
if
(
parent
.
left
===
this
)
{
parent
.
left
=
newParent
;
}
else
if
(
parent
.
right
===
this
)
{
...
...
This diff is collapsed.
Click to expand it.
src/OperationStores/RedBlackTree.spec.js
+
2
−
2
View file @
7b52111c
/* @flow */
/*eslint-env browser,jasmine */
var
numberOfTests
=
1000
;
var
numberOfTests
=
1000
00
;
describe
(
"
RedBlack Tree
"
,
function
(){
beforeEach
(
function
(){
...
...
@@ -24,7 +24,7 @@ describe("RedBlack Tree", function(){
var
elements
=
[];
var
tree
=
new
RBTree
();
for
(
var
i
=
0
;
i
<
numberOfTests
;
i
++
)
{
var
obj
=
(
Math
.
random
()
+
1
).
toString
(
36
).
substring
(
15
);
var
obj
=
Math
.
floor
(
Math
.
random
()
*
numberOfTests
*
10000
);
elements
.
push
(
obj
);
tree
.
add
({
id
:
obj
});
}
...
...
This diff is collapsed.
Click to expand it.
y.js
+
1
−
1
View file @
7b52111c
This diff is collapsed.
Click to expand it.
y.js.map
+
1
−
1
View file @
7b52111c
Source diff could not be displayed: it is too large. Options to address this:
view the blob
.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment