How do you compute the average height of a binary search tree when adding 1000 random ints? What is the average height?
You can compute the height of a binary tree using this recursive definition:
height(empty) = 0
height(tree) = 1 + max(height(tree.left), height(tree.right))
One way to empirically measure the average height of such a tree is to repeatedly create an empty tree and add 1000 random items to it. Measure the height of each trial using the above function, and average them.
I suspect your task is probably to find a formula for the average height of a binary tree.