Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

postOrder to preOrder algorithm

Name: Drexel CS 2009-01-30 18:55

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.

P.S. Python sucks for a data structures class.

Name: Anonymous 2009-01-30 19:36

Post code.

Name: Anonymous 2009-01-30 20:00

Python is at least better than Perl for organizing data. *shudder*

Name: Anonymous 2009-01-30 20:30

That problem cannot be solved with touring machines.

Name: Anonymous 2009-01-31 2:30

>>1
It is impossible using only the traversal as input. You must also have the original tree.

Name: Anonymous 2009-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.

Name: Anonymous 2009-01-31 2:41

Python is at least better than Perl for organizing data. *shudder*
you've obviously never used python.

Name: Anonymous 2009-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: Anonymous 2009-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!

Name: Anonymous 2009-01-31 7:18

post code

Name: Anonymous 2009-01-31 8:43

>>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: Anonymous 2009-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: Anonymous 2009-01-31 13:11

It is not impossible. I solved this problem many moons ago very efficiently. However, my code was stolen.

Name: Anonymous 2009-01-31 14:06

FFFFUUUUUUUUUUUUUUUUUUUUUUU---

Name: Anonymous 2009-01-31 14:27

DONT HELP HIM!!!

Name: Anonymous 2009-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 ○| ̄|_

Name: Anonymous 2009-01-31 15:04

>>16

Name: Anonymous 2009-01-31 15:50

>>17
that is not an english word why did you say it

Name: Anonymous 2009-01-31 21:34

>>18
because phone

Name: Anonymous 2009-01-31 22:27

>>19
THEN WHO WAS PHONE‽

Name: Anonymous 2011-01-31 20:16

<-- check em dubz

Name: Anonymous 2011-02-03 6:04

Name: Anonymous 2011-02-03 6:37

Don't change these.
Name: Email:
Entire Thread Thread List