Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Ternary trees

  Asked By: Abbie    Date: Jun 13    Category: Java    Views: 1164
  

How could go about programming the following methods?
I need to gain an understanding of the logic behind it so if anyone
can suggest an Algorithm for them that would be great.
All are for manipulate search trees of order 3.


int size_of_tree(TreeNode tree)
It counts the total number of nodes of the given tree and return the
number back.


int depth_of_tree(TreeNode tree)
It is returns the depth of the given tree.


TreeNode make_partial_copy(TreeNode tree)
It generates a partial copy of the given tree such that all leaves of
the tree are removed.


boolean search(TreeNode tree, String key)
It checks whether the input key is actually in the tree.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Ternary trees Or get search suggestion and latest updates.




Tagged: