Skip to content

Commit 74eaa79

Browse files
committed
Bugfixes
1 parent c87a94a commit 74eaa79

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/data-structures/red-black-tree.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,17 @@
4242
}
4343

4444
RBTree.prototype.put = function (key, value) {
45-
console.log(this._root);
4645
this._root = this._put(key, value, this._root);
4746
this._root.flipColor();
4847
};
4948

49+
RBTree.prototype.isRed = function (node) {
50+
if (!node) {
51+
return false;
52+
}
53+
return node.isRed();
54+
};
55+
5056
RBTree.prototype._put = function (key, value, node) {
5157
var newRoot = node;
5258
if (node === null) {

0 commit comments

Comments
 (0)