monmohan / dsjslib

A library implementing several standard data structures and utilities, in JavaScript. Its written and tested using Node.js which is the target platform.
MIT License
773 stars 68 forks source link

Return value of BST.put() depends on state #13

Open akloeber opened 8 years ago

akloeber commented 8 years ago

The return value of BinarySearchTree.put() differs depending on the state of the tree and is not documented.

In case of the first insertion the tree instance is returned whereas for subsequent insertions a structure like this is returned:

{
  put: [Function],
  node: [Object]
}