MATLAB Documentation for OOP
(For reference by students)


Class BinaryTree

Method Summary
  BinaryTree (data)

          Constructor that creates a binary tree

  char ( )

          The string representation of the BinaryTree

  display ( )          

          Command window display of a BinaryTree

  BFFind ( bt, data )

          Finds the node containing data from the binarytree bt using a Breadth First Search

 

BFTString  ( data )

         Tree traversal including formatting lines

 

count  ( )

         Counts the number of nodes in the binarytree bt

  DFFind (bt, data)

         Finds the node containing data from the binarytree bt using a Depth First Search

  getroot (  )

        Gets the root of the BinaryTree.

  setroot ( )

        Sets the root of the BinaryTree

  inOrder2List (  )

        Recursively does in-order processing.

  inOrderString (  )

        The string representation of the inOrder2List method

  largest ( )

        Finds the largest node in the BinaryTree

  preOrder2List ( )

        Recursive does in-order processing.

  preOrderString ( )

       The string representation of the preOrderString method

 

Method Detail

BinaryTree

bt = BinaryTree( data ) creates a BinaryTree object

If Data is another object of class BinaryTree, it will be added to its root.

bt = BinaryTree ( ) will create an empty binarytree

 

BFFind

BFFind (bt, data) finds a node containing data from the binarytree bt

 


Got comments\feedback\suggestions\complaints\anything whatsoever? Shoot the webmaster an email!

Website created & maintained by Shardul Bhatia and Wen Eu Cheah