Binqry Tree sort



Hi all,
We have an unsorted set like S. We put the elements of the set
sequentially on the leaves on a conplete binary tree. I'm looking for
an algorithm to sort the set S with this binary tree structure. The
result should be available on the leaves of the tree again.
Example:
S = {5, 2, 3, 1}

Initial Tree:
__
/ \
__ __
/ \ / \
5 2 3 1

final Tree:
__
/ \
__ __
/ \ / \
1 2 3 5

any ideas?
thanks
nejla

.



Relevant Pages

  • Re: database
    ... and Java. ... Binary trees have an elegant recursive pointer structure, ... Binary Tree Structure -- a quick introduction to binary ...
    (comp.lang.c)
  • Re: Answer to Dik T. Winter
    ... students (the "explanation" of the binary tree), ... "The state of Bavaria, situated in the south of Germany, is proud ... a complete infinite binary tree from that set of paths. ...
    (sci.logic)
  • Re: Answer to Dik T. Winter
    ... students (the "explanation" of the binary tree), ... Germany to get professorships – not by officially stated and discussed ... a complete infinite binary tree from that set of paths. ...
    (sci.logic)
  • Re: Cantor and the binary tree
    ... to do with paths on a tree, ... > nothing to do with the number of unending paths. ... Actually, if you have an infinite binary tree, with all paths unending, it's ...
    (sci.math)
  • Re: Cantor and the binary tree
    ... Rather, each one leads to another (unending, infinite) subtree. ... But for this new tree and each of its nodes the ... And if the binary tree is maximal as described, for each natural, there ... Given any maximal path in this maximal binary tree, ...
    (sci.math)