update big-o analysis in terms of tree size rather than input size