You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- extra functions like toString(), toJSON(), validate() etc.
41
+
- Main functions like insert(), delete(), each(), find() etc.
42
+
- Extended functions like entries(), Symbol.iterator, supports `for...of` loops.
43
+
- Conversion methods like fromArray(), toArray(), toString(), toJSON().
35
44
36
45
## Complete Documentation
37
46
Checkout [DOCUMENTATION.md](DOCUMENTATION.md) for complete documentation or View Documentation online at [https://dsinjs.github.io/binary-tree/](https://dsinjs.github.io/binary-tree/)
Copy file name to clipboardExpand all lines: dist/dsinjs-binarytree.js
+190-8Lines changed: 190 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,7 @@ var BTreeNode = function () {
155
155
}();
156
156
157
157
if(typeofmodule!="undefined"){
158
-
module.exports=BTreeNode;
158
+
module.exports={BTreeNode: BTreeNode};
159
159
}
160
160
if(typeofwindow!="undefined"){
161
161
window.DSinJS=window.DSinJS||{};
@@ -176,7 +176,8 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
176
176
177
177
function_inherits(subClass,superClass){if(typeofsuperClass!=="function"&&superClass!==null){thrownewTypeError("Super expression must either be null or a function, not "+typeofsuperClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor: {value: subClass,enumerable: false,writable: true,configurable: true}});if(superClass)Object.setPrototypeOf ? Object.setPrototypeOf(subClass,superClass) : subClass.__proto__=superClass;}
178
178
179
-
varBTreeNode=require('./btreenode');
179
+
var_require=require('./btreenode'),
180
+
BTreeNode=_require.BTreeNode;
180
181
181
182
/**
182
183
* @typedef {{ root: any }} BTreeRootAttrStruct
@@ -255,8 +256,9 @@ var BTree = function () {
255
256
256
257
/**
257
258
* Returns string value of given tree.
258
-
* @returns {string} Returns string value of given tree.
259
259
* @method toString
260
+
* @member
261
+
* @public
260
262
* @example
261
263
* var tree = new BTree(10);
262
264
* tree.insert(10);
@@ -275,6 +277,9 @@ var BTree = function () {
275
277
/**
276
278
* Returns JSON Form.
277
279
* @method toJSON
280
+
* @member
281
+
* @public
282
+
* @returns {BTreeNodeStruct} Returns json form of a given tree.
278
283
* @example
279
284
* var tree = new BTree(10);
280
285
* tree.insert(20);
@@ -287,11 +292,34 @@ var BTree = function () {
287
292
returnthis.root.toJSON();
288
293
}
289
294
295
+
/**
296
+
* Returns array value.
297
+
* @method toArray
298
+
* @member
299
+
* @public
300
+
* @returns {Array<BTreeNode>} Returns array form of given tree.
0 commit comments