File tree 4 files changed +28
-0
lines changed
4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ import RedBlackTree from '../types/RedBlackTree.js' ;
2
+
3
+ /**
4
+ * Same as {@link RedBlackTree.empty}.
5
+ * @function empty
6
+ */
7
+ const empty = RedBlackTree . empty ;
8
+ export default empty ;
Original file line number Diff line number Diff line change
1
+ import RedBlackTree from '../types/RedBlackTree.js' ;
2
+
3
+ /**
4
+ * Same as {@link RedBlackTree.from}.
5
+ * @function from
6
+ */
7
+ const from = RedBlackTree . from ;
8
+ export default from ;
Original file line number Diff line number Diff line change
1
+ export { default as empty } from './api/empty.js' ;
2
+ export { default as from } from './api/from.js' ;
1
3
export { default as BLACK } from './color/BLACK.js' ;
2
4
export { default as RED } from './color/RED.js' ;
3
5
export { default as _debug } from './debug/_debug.js' ;
Original file line number Diff line number Diff line change @@ -165,6 +165,16 @@ export default class RedBlackTree {
165
165
return this . items ( ) ;
166
166
}
167
167
168
+ /**
169
+ * Constructs an empty red-black tree.
170
+ *
171
+ * @param {Function } compare - The comparison function to use.
172
+ * @returns {RedBlackTree }
173
+ */
174
+ static empty ( compare ) {
175
+ return new RedBlackTree ( compare ) ;
176
+ }
177
+
168
178
/**
169
179
* Constructs a red-black tree from an input iterable.
170
180
*
You can’t perform that action at this time.
0 commit comments