From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d4c0eb138f4953e2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-01 18:41:42 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!wn1feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc06-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3C32732A.244C83B@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Non destructive summation of nodes (Linked List/FIFO Queue) References: <3C326B1A.E1209806@otelco.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 02 Jan 2002 02:41:41 GMT NNTP-Posting-Host: 12.86.37.220 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc06-news.ops.worldnet.att.net 1009939301 12.86.37.220 (Wed, 02 Jan 2002 02:41:41 GMT) NNTP-Posting-Date: Wed, 02 Jan 2002 02:41:41 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:18430 Date: 2002-01-02T02:41:41+00:00 List-Id: 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