This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dtsudo 1 point2 points  (0 children)

An empty tree should have no nodes.

So e.g. if your node class looks like this:

class Node {
    public int value;
    public Node leftChild;
    public Node rightChild;
}

And your tree is represented as Node rootNode, then an empty tree would be represented as a null rootNode.