I'm working in the confines of a binary search tree and an AVL tree, doing some operations to find different statistics for these trees when given large random values. For instance some of my functions include finding the average leaf node depth, find the shallowest leaf node, etc.

My question is what is the best way to go through these trees and calculate such values, noting which level things are found, etc. I was considering a level order traversal but I'm not sure the implementation.

Any hints or advice will help, Thanks!

Edit: Any tips about keeping a height variable with that would be helpful too.

Edited by dolfan55aj: additional help, clarification

5 Years
Discussion Span
Last Post by mazzica1
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.