Does anyone know of a quick way to convert from postorder to preorder? We're trying to convert from postorder input of a binary tree traversal, to inorder and preorder. We've got inorder down, but can't think of a universal way to get to preorder.
Python is at least better than Perl for organizing data. *shudder*
Name:
Anonymous2009-01-30 20:30
That problem cannot be solved with touring machines.
Name:
Anonymous2009-01-31 2:30
>>1
It is impossible using only the traversal as input. You must also have the original tree.
Name:
Anonymous2009-01-31 2:33
you could randomly generate a tree and there's some probability (a function of the number of nodes i guess idk) that it would be correct. or generate the entire set of trees which correspond to the traversal.
Python is at least better than Perl for organizing data. *shudder*
you've obviously never used python.
Name:
Anonymous2009-01-31 4:15
>>1
>P.S. Python sucks for a data structures class.
WHAT THE FUCK KIND OF SCHOOL USES PYTHON TO TEACH DATA STRUCTURES? Data structures should be taught using C/C++ so that you get a feel for how the structures are actually implemented in the machine, which helps you understand why certain structures have certain algorithmic complexities!
Name:
Anonymous2009-01-31 7:02
WHAT THE FUCK KIND OF SCHOOL USES PYTHON TO TEACH DATA STRUCTURES‽ Data structures should be taught using ML/Haskell so that you get a feel for how you can actually mathematically reason about structures, which helps you understand why certain structures have certain algorithmic complexities!
>>8
Memory management and pointer tricks have little to do with data structures. Unless you do something amazingly stupid, you'll have the same complexity either way.
Name:
Anonymous2009-01-31 12:39
>>8,9 OR the professor can teach the ``mathematical complexities" aka ``abstract bullshite"without code at all so that the language of choice does not matter.
Name:
Anonymous2009-01-31 13:11
It is not impossible. I solved this problem many moons ago very efficiently. However, my code was stolen.
Name:
Anonymous2009-01-31 14:06
FFFFUUUUUUUUUUUUUUUUUUUUUUU---
Name:
Anonymous2009-01-31 14:27
DONT HELP HIM!!!
Name:
Anonymous2009-01-31 14:41
>>14
Nothing pisses me off more than seeing you stupid whiteasses trying to talk like 2ch users. Shut the fuuu.... fuuuu.... fuuuu fuuuuuuu ふぅぅうぅうぅぅうぅぅぅう wwwwwwww(・∀・)吹いたああぁぁあwwww ○| ̄|_