Skip to content

BrendM/JavaScript-N-ary-Tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

JavaScript-N-ary-Tree

This is a tree structure similar to an N-ary tree implementation in javascript.

Duplicate nodes are allowed.

Core Methods include:

Search for a node

All nodes greater than specified node

All nodes less than specified node

Copy all nodes to array in order based on comparator

Min and max nodes

Iterate over all nodes in the tree in order

Example usage:

var mTree = new MTree(5, 7);

var array = new Array();

for (var i = 1000; 0 < i; i--) {//1000 random elements

array.push(Math.floor((Math.random() * 1000)));

}

mTree.insertArray(array);

mTree.search(42);

About

Some js ADT's

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors