Package dsa.iface
Interface IBinaryTree<T>
- All Superinterfaces:
ITree<T>
- All Known Implementing Classes:
AbstractBinaryTree
Interface to represent a Binary Tree.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Check whether positionp
has a left child.boolean
Check whether positionp
has a right child.Get the left child of positionp
.Get the right child of positionp
.
-
Method Details
-
left
Get the left child of positionp
.- Parameters:
p
-- Returns:
-
right
Get the right child of positionp
.- Parameters:
p
-- Returns:
-
hasLeft
Check whether positionp
has a left child.- Parameters:
p
-- Returns:
true
if positionp
has a left child,false
otherwise.
-
hasRight
Check whether positionp
has a right child.- Parameters:
p
-- Returns:
true
if positionp
has a right child,false
otherwise.
-