944,028 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 2582
  • C RSS
Aug 8th, 2006
0

Binary Search Trees

Expand Post »
Hey,

I need help with finding out if BSTs are height and size balanced, Ive got plenty of books and people telling me different things but i need it to click in my own head! Any ideas or simple ways of doing it?

Thankyas!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
LearninKaz is offline Offline
2 posts
since Aug 2006
Aug 8th, 2006
0

Re: Binary Search Trees

Quote originally posted by LearninKaz ...
Hey,

I need help with finding out if BSTs are height and size balanced, Ive got plenty of books and people telling me different things but i need it to click in my own head! Any ideas or simple ways of doing it?

Thankyas!
What do you mean height and size balanced.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Aug 8th, 2006
0

Re: Binary Search Trees

apparently, a search tree is size balanced if the numbers of the nodes in the left and right subtrees of every node differ by no more than one. and height balanced (AVL balanced) if the heights of the left and right subtrees of every node differ by no more than one.

Confusing! I was just wondering if anyone had any tips or tricks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
LearninKaz is offline Offline
2 posts
since Aug 2006
Aug 8th, 2006
0

Re: Binary Search Trees

Quote originally posted by LearninKaz ...
apparently, a search tree is size balanced if the numbers of the nodes in the left and right subtrees of every node differ by no more than one. and height balanced (AVL balanced) if the heights of the left and right subtrees of every node differ by no more than one.

Confusing! I was just wondering if anyone had any tips or tricks
Did you try Google? You can find recursive functions to determin height of binary tree. Yo can apply that functions to determine height of left and right subtree. Try and see will it work...
Reputation Points: 55
Solved Threads: 6
Junior Poster
Micko is offline Offline
148 posts
since Aug 2005
Aug 9th, 2006
0

Re: Binary Search Trees

if i were you, id rather go with ipr or avl trees which are more balanced than simple b ones. coding may be more diffucult but if you are able to find a pre written b+ or b#tree class/sstructure, it'll be working faster.
Reputation Points: 11
Solved Threads: 0
Newbie Poster
b2daj is offline Offline
8 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: plz suggest me how to do this program
Next Thread in C Forum Timeline: How to do text fade in and fade out effect





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC