@walkerrandolphsmith/binary-tree

7.0.2 • Public • Published

Binary Tree

    4
  /   \
2       6
  \   /   \
   3 5     8

Binary trees are a type of tree which is a type of graph used to store comaparable data such that all elemnts on the left subtree are less than a node and all elements on the right subtree are greater than a node.

isEmpty() Determine if there are any elements in the tree.

getData() Retreive the element at the root of the tree.

isLeaf() Determine if the tree is a leaf node.

getLeftSubtree() Retrieve the tree that is the left child of the current root node.

getRightSubtree() Retrieve the tree that is the right child of the current root node.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @walkerrandolphsmith/binary-tree

      Weekly Downloads

      2

      Version

      7.0.2

      License

      ISC

      Unpacked Size

      4.15 kB

      Total Files

      5

      Last publish

      Collaborators

      • walkerrandolphsmith