public class DecisionTree
extends java.lang.Object
Constructor and Description |
---|
DecisionTree()
Default Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
depth()
It returns the depth of the tree
|
TreeNode |
getRoot()
It returns the root of the tree
|
void |
setRoot(TreeNode root)
It set the root of the tree
|
java.lang.String |
toString()
Returns tree as a String in preorder format.
|
public TreeNode getRoot()
public void setRoot(TreeNode root)
root
- the root to setpublic int depth()
public java.lang.String toString()
toString
in class java.lang.Object