asd_library.tree.tree
Interface Tree_adt


public interface Tree_adt

The abstract data type of a generic tree.


Method Summary
 java.util.ListIterator children(TreeNode v)
           
 java.lang.Comparable element(TreeNode v)
          method to get element field.
 boolean isLeaf(TreeNode v)
          Verifies if the node v is a leaf.
 boolean isRoot(TreeNode v)
          Verifies if the node v is the root.
 TreeNode parent(TreeNode v)
          Return the parent node of node v
 TreeNode root()
          Returns the root of this tree.
 

Method Detail

element

public java.lang.Comparable element(TreeNode v)
method to get element field.

Parameters:
v - the node.
Returns:
the element field or null if this node is null.

root

public TreeNode root()
Returns the root of this tree.

Returns:
the root node.

parent

public TreeNode parent(TreeNode v)
Return the parent node of node v

Returns:
the TreeNode that is v's parent .

children

public java.util.ListIterator children(TreeNode v)

isLeaf

public boolean isLeaf(TreeNode v)
Verifies if the node v is a leaf.

Parameters:
v - the node
Returns:
true if v is a leaf, false otherwise.

isRoot

public boolean isRoot(TreeNode v)
Verifies if the node v is the root.

Parameters:
v - the node
Returns:
true if v is the root, false otherwise.