+ Reply to Thread
Results 1 to 7 of 7

Thread: Balancing Binary Search Trees

  1. #1
    Newbie Daskill is an unknown quantity at this point
    Join Date
    Dec 2008
    Posts
    24

    Unhappy Balancing Binary Search Trees

    I'm having trouble grasping the theory of balancing binary search trees and I was wondering if someone in the know could explain it to me?

  2. #2
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,673
    Blog Entries
    57

    Re: Balancing Binary Search Trees

    There's an important question before I attempt to address the question: Are you talking about height balancing or balancing for optimal searching or something else?
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  3. #3
    Newbie Daskill is an unknown quantity at this point
    Join Date
    Dec 2008
    Posts
    24

    Re: Balancing Binary Search Trees

    It doesn't say specifically, but I think it's height-balancing.

  4. #4
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,673
    Blog Entries
    57

    Re: Balancing Binary Search Trees

    OK, I'll have to do a little research (I haven't specifically studied the topic, but tend to pick these things up quickly). I'll try to have something later today.
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  5. #5
    Newbie Daskill is an unknown quantity at this point
    Join Date
    Dec 2008
    Posts
    24

    Re: Balancing Binary Search Trees

    You're very kind, thank you.

  6. #6
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,673
    Blog Entries
    57

    Re: Balancing Binary Search Trees

    Wikipedia has a nice article on AVL trees (balanced binary trees) and an excellent diagram of the reassignments needed to shift it into balance. It's a pretty simple matter of shuffling some pointers around.
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  7. #7
    Co-Administrator John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John's Avatar
    Join Date
    Jul 2006
    Age
    21
    Posts
    5,885
    Blog Entries
    25

    Re: Balancing Binary Search Trees

    It should be noted that an AVL Tree is a specific type of Binary Search Tree (which itself is a specific type of a Binary Tree). Generally speaking, a Binary Search Tree makes no restriction on its hight; A BST only has an order property and it requires that the left child is less than its parent and the right child is greater than its parent. So in the best case scenario, a BST it could be logarithmic in size or in the worst case it could be linear in size. An AVL tree prevents the worst case scenario, and is thus a bit more complicated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Need help with binary trees.
    By Daskill in forum General Programming
    Replies: 9
    Last Post: 12-08-2008, 10:13 AM
  2. Computer Theory: Signed Integers
    By John in forum Tutorials
    Replies: 3
    Last Post: 11-30-2008, 09:00 AM
  3. Google Hacking
    By John in forum Tutorials
    Replies: 6
    Last Post: 07-22-2008, 09:37 AM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts