What javascript tree data structures are available?
JavascriptTreeJavascript Problem Overview
Are there good libraries for manipulating trees in javascript? Just to be clear, I am looking for tree as in data structure not display model.
Javascript Solutions
Solution 1 - Javascript
Here are some libraries that you may find helpful:
arboreal.js, a "micro-library for traversing and manipulating tree-like data structures" in node.js and the browser.
buckets, a "complete, fully tested and documented data structure library" that includes BSTs, a heap, and a bunch of other goodies.
Solution 2 - Javascript
Two libraries to add to the list are:
disclaimer: I built TreeModel
Solution 3 - Javascript
Try the DOM
var o = document.createElement( 'WHAT_YOU_WANT' )
// o.appendChild( ... )
Solution 4 - Javascript
Wish I'd seen that solution before, because those libraries look helpful!
Here is one I put together which is an alternative. Meant for traversal, manipulation and loading of hierarchical tree structures from self referencing flat tables, not for balanced binary trees.
Solution 5 - Javascript
I am not sure what your needs are so this is a shot in the dark. I normally use (for lightweight Javascript) an array of arrays, like this:
node[i] = [parent, firstChild, secondChild, ... nthChild];
Solution 6 - Javascript
I wrote one simple data oriented tree library called data-tree. You can use this to create, traverse and search tree in BFS/DFS fashion. You can also import/export data from tree. Checkout the detailed documentation at: http://cchandurkar.github.io/Data-Tree/
To use it in a node npm install data-tree