Binary Tree
Definition
public class TreeNode {
int key;
TreeNode leftChild;
TreeNode rightChild;
public TreeNode(int value) {
key = value;
leftChild = null; // not necessary
rightChild = null; // java does this during initialization
}
}public class TreeNode {
public String name;
public Node[] children;
}DFS in Binary Tree
References
Last updated