We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent befc789 commit 430ea18Copy full SHA for 430ea18
src/types/RedBlackTree.js
@@ -1,5 +1,6 @@
1
import assert from 'assert';
2
import Node from './Node.js';
3
+import Leaf from './Leaf.js';
4
import BLACK from '../color/BLACK.js';
5
import RED from '../color/RED.js';
6
import predecessor from '../family/predecessor.js';
@@ -108,6 +109,8 @@ export default class RedBlackTree {
108
109
// child.
110
const succ = node.right;
111
assert(succ instanceof Node);
112
+ assert(succ.left instanceof Leaf);
113
+ assert(succ.right instanceof Leaf);
114
node.key = succ.key;
115
// Delete successor node
116
// note: this node can only have one non-leaf child
0 commit comments