From: James Rogers <jimmaureenrogers@worldnet.att.net>
Subject: Re: Non destructive summation of nodes (Linked List/FIFO Queue)
Date: Wed, 02 Jan 2002 02:41:41 GMT
Date: 2002-01-02T02:41:41+00:00 [thread overview]
Message-ID: <3C32732A.244C83B@worldnet.att.net> (raw)
In-Reply-To: 3C326B1A.E1209806@otelco.net
Of course, a very simple solution is to merely create a "print"
procedure for the Queue type. This procedure could visit each node
in the queue and Put the element without removing any element from the
Queue.
Jim Rogers
Larry Hazel wrote:
>
> Another thought is to add each removed element to another queue. So, you've
> still got the queue after displaying each element. It just has a different
> name.
>
> Liddle Feesh wrote:
> >
> > Michal suggested:
> >
> > while not (Queue.Is_Empty_Queue(Queue) ) loop
> > Queues.Remove (Element, Queue);
> -- Add the removed element to another queue
> Queues.Add (Element, Another_Queue);
> > Put(Element);
> > New_Line;
> > end loop;
> >
> > ------
> >
> > However, the above basically removes each node whilst 'counting' back the
> > values stored in each.
> >
>
> Larry
next prev parent reply other threads:[~2002-01-02 2:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-01 23:02 Non destructive summation of nodes (Linked List/FIFO Queue) Liddle Feesh
2002-01-02 0:50 ` Larry Hazel
2002-01-02 2:06 ` Larry Hazel
2002-01-02 2:41 ` James Rogers [this message]
2002-01-02 11:17 ` Michal Nowak
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox