Skip to content

Commit 3d9d535

Browse files
committed
Do not check height.
1 parent bddeca7 commit 3d9d535

File tree

2 files changed

+0
-3
lines changed

2 files changed

+0
-3
lines changed

src/data-structures/size-balanced-tree.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ function CreateSBTreeClass (Node, Nil, updateChild) {
309309
this.left = left;
310310
this.right = right;
311311
this.size = size;
312-
this.height = 0;
313312
};
314313

315314
var createNil = function (Node, value) {
@@ -328,7 +327,6 @@ function CreateSBTreeClass (Node, Nil, updateChild) {
328327
*/
329328
var updateSize = function () {
330329
this.size = this.left.size + this.right.size + 1;
331-
this.height = Math.max(this.left.height, this.right.height) + 1;
332330
};
333331

334332
// node, childNode must not be Nil,

test/data-structures/size-balanced-tree.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ describe('SBTree', function () {
103103
var node = sTree.get(i);
104104
expect(node.value).toBe(i);
105105
}
106-
expect(sTree._root.height).toBe(18);
107106
for (var i = 0; i < 200000; ++i) {
108107
expect(sTree.get(0).value).toBe(i);
109108
var node = sTree.remove(0); // Always remove the first element;

0 commit comments

Comments
 (0)