Basic BST questions

From: Davey (davey_at_hello.com)
Date: 02/28/05


Date: Mon, 28 Feb 2005 18:03:00 +0100

I understand the purpose of a Binary Search Tree and I understand what a
full tree represents, but I don't understand a couple of fundamental
concepts regarding this data structure.

First of all, I'm not sure how objects are added to a tree. Say we create a
tree which holds characters and we have an array with the characters X, Q,
I, T, A, S, P, B and C. How do these characters from the array get added to
the tree? In the order they are in the array? i.e. X first, then Q as the
left node of X, then I as the left node of Q, then what with T? Then how do
we get a balanced tree that is useful for searching?

Any help would be appreciated.



Relevant Pages

  • Re: "Size Balanced Tree" - more efficient than any known algorithm?
    ... fundamental and heavily attacked things like the binary search tree it ... Balanced Tree is, as the name suggests, a Binary Search Tree (abbr. ... Its runtime matches that of the fastest BST ...
    (comp.theory)
  • Re: Searching a treap
    ... a cartesian tree _is_ a binary search tree. ... all priorities are heap-ordered (that is the priority of a node is ...
    (comp.theory)
  • Re: Fastest Binary Tree Balancing Algorithm
    ... > for a binary search tree (BST)? ... "The sound of peacocks being shredded can't possibly be ...
    (comp.programming)
  • Re: Depth First Search in Binary Search Tree?
    ... one path before moving sideways at all. ... You keep using the term 'tree'. ... It's about searching in a binary search tree. ... Sure, if you're traversing a graph using the depth-first method, you might ...
    (comp.programming)
  • Re: Depth First Search in Binary Search Tree?
    ... one path before moving sideways at all. ... You keep using the term 'tree'. ... It's about searching in a binary search tree. ... Sure, if you're traversing a graph using the depth-first method, you might ...
    (comp.programming)