Skip to content

Commit

Permalink
Do not check height.
Browse files Browse the repository at this point in the history
  • Loading branch information
lygstate committed Jan 6, 2016
1 parent bddeca7 commit 3d9d535
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/data-structures/size-balanced-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ function CreateSBTreeClass (Node, Nil, updateChild) {
this.left = left;
this.right = right;
this.size = size;
this.height = 0;
};

var createNil = function (Node, value) {
Expand All @@ -328,7 +327,6 @@ function CreateSBTreeClass (Node, Nil, updateChild) {
*/
var updateSize = function () {
this.size = this.left.size + this.right.size + 1;
this.height = Math.max(this.left.height, this.right.height) + 1;
};

// node, childNode must not be Nil,
Expand Down
1 change: 0 additions & 1 deletion test/data-structures/size-balanced-tree.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ describe('SBTree', function () {
var node = sTree.get(i);
expect(node.value).toBe(i);
}
expect(sTree._root.height).toBe(18);
for (var i = 0; i < 200000; ++i) {
expect(sTree.get(0).value).toBe(i);
var node = sTree.remove(0); // Always remove the first element;
Expand Down

0 comments on commit 3d9d535

Please sign in to comment.