From: Peter Amey <pna@praxis-cs.co.uk>
Subject: Re: implementation for multiple stacks
Date: 1997/10/01
Date: 1997-10-01T00:00:00+00:00 [thread overview]
Message-ID: <3432AE2A.35C8@praxis-cs.co.uk> (raw)
In-Reply-To: 19971001052200.BAA25591@ladder02.news.aol.com
FloydJen wrote:
>
> How do i write the push and pop etc. procedures for multiple stacks?
> FloydJen@aol.com
This is a classic use for an abstract data type. Declare a package
exporting a private stack type. The stack can be implemented as a
record with an array for the stack and a scalar for the stack pointer.
Operations will have an in out parameter of the private stack type.
Users of the package declare themselves a variable of the abstract stack
type at the point of use and use the operations provided by the package
to manipulate it. Multiple instances of variables of the stack type can
exist at once and remain independent.
Peter
prev parent reply other threads:[~1997-10-01 0:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-10-01 0:00 implementation for multiple stacks FloydJen
1997-10-01 0:00 ` Peter Amey [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox