Re: doing things with binary trees



In Dread Ink, the Grave Hand of Andrew Tomazos Did Inscribe:

On Apr 26, 1:07 am, Franken Sense <fr...@xxxxxxxxxxxxxxx> wrote:
I've been shaking the bugs out of this program, that would read lines of
text using a binary tree.

The first thing I'd like to do with this tree is print it.  I have code for
it here, and it works almost flawlessly.  It does, however, print the root
node last.  How do I fix it:

I can't reproduce the problem. I ran it on the following test file:

1
2
4
3
3
5
2

The output of the program was:

-- 1
1
-- 1
2
-- 2
3
-- 2
4
-- 1
5
-- 1

Which looks correct to me?

-Andrew.

All of them.
--
Frank

Oh, What Doesn't Kill You Can Have Lingering Aftereffects!
~~ Al Franken,
.



Relevant Pages

  • Re: writing get_script()
    ... the Grave Hand of Jürgen Exner Did Inscribe: ... However there is no reason why not to build a binary tree in Perl. ... No Child Left Behind is the most ironically named act, ...
    (comp.lang.perl.misc)
  • Re: writing get_script()
    ... the Grave Hand of Jürgen Exner Did Inscribe: ... A quick search for 'Binary Tree" on CPAN returns several hundred ...
    (comp.lang.perl.misc)
  • Re: doing things with binary trees
    ... the Grave Hand of Andrew Tomazos Did Inscribe: ... definition for a binary tree from the perspective of graph theory, ...
    (comp.programming)