constructing a binary tree given the inorder and postorder traversals

S

Santosh

hello.
this is my first post in this group.
i would like to know ,if for the question given below it is possible
to construct a binary tree.
the two traversals given are:
postorder:[A,B,C,D,E,G,F,H,I,J]
inorder:[B,C,A,E,G,D,H,F,I,J]

P.S.i cannot confirm the validity of the question.
In my opinion a solution is not possible.
I just want to confirm it
 
L

Lew Pitcher


Hi, Santosh
this is my first post in this group.
i would like to know ,if for the question given below it is possible
[snip]

Sorry, Santosh, but this isn't the proper forum to ask your question in.
Your question has to do with tree-traversal algorithms and doesn't have
anything to do with the C language. If you post a question about a C
implementation of a tree-traversal, you might get a reasonable answer here.

Perhaps you can repost your question to a better suited newsgroup, or
rephrase it such that it fits within the topicallity of comp.lang.c

(Hint: you might find an answer in Knuth's "The Art of Computer
Programming". IIRC, Volume 3 ("Sorting And Searching") has quite a
comprehensive writeup on the various tree search algorithms.)

--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
 
S

Santosh

     Too bad it's the wrong group.  This group is for questions
about the C language, not for general programming or algorithmic
topics.  Try comp.programming, perhaps.

thank you and sorry for posting in the wrong forum
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,954
Messages
2,570,116
Members
46,704
Latest member
BernadineF

Latest Threads

Top