开发者

Question about Binary Search Tree?

Today, in class my profes开发者_开发问答sors said there's a balance binary search tree which I never heard of it before. I would like to know is there a Balance Binary Search tree without rotation? From my understanding, Balance Binary Search Tree is AVL tree. Besides that I don't think it's possible to build a 'Balance Binary Search Tree'. But if in case there's a data structure like that, how could I build a 'Balance Binary Search Tree' from a series of random numbers?

Thanks,


The idea behind populating balanced binary search tree using random numbers is like you will be adding nodes to the tree, whose keys are random numbers. When you'll implement a balanced binary search tree, populate it with 100s or 1000s of nodes with random number. The height should be as small as possible - which is the key feature of balanced binary search tree.

There exists balanced binary search trees other than AVL trees (like Red-Black Tree). Search google with balanced binary search tree.


Wikipedia has a nice list of trees at the bottom of any tree related article such as http://en.wikipedia.org/wiki/Self-balancing_binary_search_tree

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜