in reply to Re^3: Challenge: Dumping trees.
in thread Challenge: Dumping trees.
I was not able to reproduce the anomalies,
Okay.
At first, I assumed this must be because you were using a different rand to me. I guessed you might be running on some flavour of *nix -- but then I noticed your use of notepad above -- which squashed that idea.
Then I thought you might be running some other flavour of windows perl -- perhaps Strawberry. So, I thought I'd re-generate the failing test cases using my version of the generator and supply you with the generated trees.
Did I change the generator between posting and now? I don't remember, but I can only assume that something in the original code I used, that used rand has changed.
Never mind: I'll reverse engineer the output I posted back to a raw tree structure and give you that.
But I did it!
Which fed to your dumper produces the same (malformed) dump that I originally posted:
C:\test>anonBinTreeDumper.pl _____________________________/\___________________________________ +___________________________________________________ _/\___________________ + ___________________________________/\ /\ _________/\_______ _________________ +______________/\_______________________________ Z a b _____/\_______ _____/\ ____/\________________ +_____ _______________/\_ _/\___ _____/\ /\_ q ___/\ _______________ +____/\_______ _____/\_ /\ /\ _/\ /\_ l m /\_ _/\_ _/ /\___ + ___/\ _______/\___ /\_________ X Y c d /\ g h /\_ n /\ _____/\ //\ 1 _/\___ + _/\_ G /\_____ _/\ P _/\_ e f i /\ o p /\___ v wyxz /\ _/\______ +_ /\ /\ H ___/\ /\ O ___/\ /\ j k r _/\ 2 3 /\ _____ +/\_ C D E F /\_ L M N _/\_ U V W /\ u 4 5 /\_ + /\ I /\ /\ /\ s t 6 /\_ + A B J K Q R S T 7 /\ 8 9
But that raises another problem...
And that raises the final problem.
I don't think that it is possible for the generator to produce bad trees -- but I haven't proven that.
Looking at the spacing between the 'z' and the '1' nodes, the gap is too big, which makes me think it is a artifact of the dumper.
At that point, I manually made the simplest correction to the raw tree that (I thought) would make it valid:
and re-ran the dumper. As you can see, it still produces the identical, malformed dump:
C:\test>anonBinTreeDumper.pl _____________________________/\___________________________________ +___________________________________________________ _/\___________________ + ___________________________________/\ /\ _________/\_______ _________________ +______________/\_______________________________ Z a b _____/\_______ _____/\ ____/\________________ +_____ _______________/\_ _/\___ _____/\ /\_ q ___/\ _______________ +____/\_______ _____/\_ /\ /\ _/\ /\_ l m /\_ _/\_ _/ /\___ + ___/\ _______/\___ /\_________ X Y c d /\ g h /\_ n /\ _____/\ //\ 1 _/\___ + _/\_ G /\_____ _/\ P _/\_ e f i /\ o p /\___ v wyxz /\ _/\______ +_ /\ /\ H ___/\ /\ O ___/\ /\ j k r _/\ 2 3 /\ _____ +/\_ C D E F /\_ L M N _/\_ U V W /\ u 4 5 /\_ + /\ I /\ /\ /\ s t 6 /\_ + A B J K Q R S T 7 /\ 8 9
So then I fed that corrected tree to my dumper:
C:\test>perl \perl64\site\lib\Tree\Dump.pm ____________________________________________________ +_________________________________ _____________/ + \___________________ _/ \_________ __________ +_________________________________/ \ / \ _____/ \_____ _______/ + \_______________ Z a b ___/ \_____ _/ \ _____/ \__________ +___________ ___/ \_ _/ \_ _/ \ / \_ q _/ \ ___/ + \___ _______/ \_________ / \ / \ _/ \ / \_ l m / \_ ___/ \_ _/ / \___ + _/ \ ___/ \_ / \_ X Y c d / \ g h / \_ n / \ ___/ \ / \ / \ 1 _/ \___ + _/ \_ G / \___ _/ \ P ___/ \_ e f i / \ o p / \_ v w x y z / \ _/ \__ +___ / \ / \ H _/ \ / \ O _/ \ / \ j k r _/ \ 2 3 / \ _/ + \_ C D E F / \_ L M N _/ \_ U V W / \ u 4 5 / \_ + / \ I / \ / \ / \ s t 6 / \ +_ A B J K Q R S T 7 / + \ 8 + 9
At this point, I'm kicking the ball into your court to decide if it is worth pursuing further?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Challenge: Dumping trees.
by Anonymous Monk on Oct 15, 2012 at 22:03 UTC |