/binary-tree

this class houses a binary tree, small test included

Primary LanguageC++

binary-tree

this class houses a binary tree, small test included

the binary tree is made up of a Node class with the following elements:

  • double val; <- value stored in the node
  • Node * Left; <- pointer to left node (NULL if not initialized)
  • Node * Right; <- pointer to next right node(also NULL if not initialized)

Functions provided by Node class:

  • Search <- looks for the
  • IsBigger <- looks for any bigger Value in the tree than the given
  • IsSmaller <- looks for any smaller value in the tree than given
  • HowMany <- looks for the number of occunrences of the given value and returns the number
  • Sum <- Gets the sum of all node values !!!! Not Tested Yet!!!!
  • NumOfNodes <- Counts the sum of Nodes in the tree !!!! Not tested !!!!
  • Average <- gets the NumOfNodes and the sum and calculates the verage !!!!Not Tested Yet !!!!