🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.pascal
Article #1

Re: Help with Pascal program

#1
From: Pula
Date: Thu, 14 Nov 1985 19:47
42 lines
1749 bytes
> I need help with the following tree program.  I don't want to write 
> any more tree programs.
> 
> Given the preorder and inorder traversals of a binary tree, build the tree
> and print the postorder traversal of it.
> 
> Read the input read into two lists.  The tree should be built using
> pointers.
> 
> The algorithm goes like this.  Given LIST1 (preorder) and LIST2 (inorder).
> The first node of LIST1 is the root of the tree.  This node is in the
> middle of LIST2, and partitions it into left and right sublists.  LIST1 is
> then partitioned into sublists.  Apply this recursively.
> 
> Please have the program echo the input, use lots of routines (makes for
> easier reading.
> 
> Thanks alot.  Oh yeah, here's some test data.
> 
> LIST1		LIST2
> -----		-----
> 
> A		A
> ABDEHCFGI	DBHEAFCGI
> BCA		ABC		(this will give an error)
> 
> 
> 	Thanx alot folks.  Your help is appreciated.
> 
> 				Ronny



    YOU'VE GOT TO BE KIDDING!  OK folks, let's all help Ronny with
    his homework assignment.  Geez Ron, couldn't you even try to 
    start it out?  This is what I'd really call chutzpah!


-- 

Mike
!ihnp4!ihlpm!michael1
Technical Details
Message-ID: <590@ihlpm.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!ihnp4!ihlpm!michael1
References: <206@ur-tut.UUCP> <2047@aecom.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84 exptools; site ihlpm.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!ihnp4!ihlpm!michael1
From: michael1@ihlpm.UUCP (Pula)
Newsgroups: net.lang.pascal
Subject: Re: Help with Pascal program
Message-ID: <590@ihlpm.UUCP>
Date: Thu, 14-Nov-85 14:47:10 EST
Article-I.D.: ihlpm.590
Posted: Thu Nov 14 14:47:10 1985
Date-Received: Sat, 16-Nov-85 01:06:20 EST
References: <206@ur-tut.UUCP> <2047@aecom.UUCP>
Distribution: net
Organization: AT&T Bell Laboratories
Lines: 42