954,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Finding level statistics for a BST

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.

dolfan55aj
Newbie Poster
5 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

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

mazzica1
Junior Poster
147 posts since Oct 2011
Reputation Points: 9
Solved Threads: 27
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: