Binary Search Trees

Reply

Join Date: Aug 2006
Posts: 2
Reputation: LearninKaz is an unknown quantity at this point 
Solved Threads: 0
LearninKaz LearninKaz is offline Offline
Newbie Poster

Binary Search Trees

 
0
  #1
Aug 8th, 2006
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!
:confused: Karen;)
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Binary Search Trees

 
0
  #2
Aug 8th, 2006
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.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2
Reputation: LearninKaz is an unknown quantity at this point 
Solved Threads: 0
LearninKaz LearninKaz is offline Offline
Newbie Poster

Re: Binary Search Trees

 
0
  #3
Aug 8th, 2006
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
:confused: Karen;)
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 148
Reputation: Micko is on a distinguished road 
Solved Threads: 6
Micko Micko is offline Offline
Junior Poster

Re: Binary Search Trees

 
0
  #4
Aug 8th, 2006
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...
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 8
Reputation: b2daj is an unknown quantity at this point 
Solved Threads: 0
b2daj b2daj is offline Offline
Newbie Poster

Re: Binary Search Trees

 
0
  #5
Aug 9th, 2006
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC