Keeping a balanced binary tree!
Greetings all,
What is the best way to keep an binary tree balanced? I been looking at articles and the only "well" documented one stated:
1) copy all the elements into another array in ascending order.
2)clear tree
3) re-add the elements(the middle element in the array would be the new parent).
Any assistance is sure appreciated. Thx!
-----------------------------
"There are ones that say they can and there are those who actually do."
"...u can not learn programming in a class, you have to learn it on your own."
Edited by - cMADsc on February 25, 2002 6:17:06 PM
Google for Red-black trees, AVL-trees and splay trees. This might also be a good place to look: http://www.nist.gov/dads/
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement