N - type of nodepublic class BinaryTree<N extends BinaryTree.Node> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BinaryTree.Node
Node of a binary tree.
|
| Constructor and Description |
|---|
BinaryTree(N root)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
depth()
Returns the depth of the tree.
|
N |
getRoot()
Returns the root node.
|
int |
numNodes()
Returns the number of nodes in the tree.
|
public BinaryTree(N root)
root - root nodepublic int numNodes()
public int depth()
public N getRoot()
Copyright © 2016. All rights reserved.