1.11M Members

Finding level statistics for a BST

 
0
 

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.

 
0
 

can you elaborate what you want exactly!! with some code effort

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: