comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: Queue
Date: Sat, 01 Dec 2001 19:32:46 GMT
Date: 2001-12-01T19:32:46+00:00	[thread overview]
Message-ID: <3C093056.A4F52211@acm.org> (raw)
In-Reply-To: K%7O7.1199$003.339380@news11-gui.server.ntli.net

steve wrote:
> 
> i have sent up a queue package using head and tail pointers, and have
> procedures for adding, removing and nodes. But l am haveing trouble writing
> a procedure for displaying the nodes. Can anyone send me a procedure where
> you can display all the nodes.

That's quite simple:

generic -- Display_Nodes
   with function End_Of_Nodes return Boolean;
   with function Get (Q : Queue) return Node;
   with procedure Next (Q : in out Queue);
   with procedure Display (N : in Node);
procedure Display_Nodes (Q : in out Queue);

procedure Display_Nodes (Q : in out Queue) is
   -- null;
begin -- Display_Nodes
   All_Nodes : loop
      exit All_Nodes when End_Of_Nodes (Q);

      Display (N => Get (Q) );
      Next (Q => Q);
   end loop All_Nodes;
end Display_Nodes;

Seriously, since we have no idea what your queue package looks like,
what a node looks like, or what you mean by "display", how can you
expect anyone here to be able to do this? If, as seems likely, this is a
homework assignment, no one here will do your homework for you. Your
first place to go for help should be your instructor. If you have
specific problems and your instructor can't help you, then we might be
able to help with a clearly stated and narrowly focused question.

-- 
Jeff Carter
"We call your door-opening request a silly thing."
Monty Python & the Holy Grail



  reply	other threads:[~2001-12-01 19:32 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-30 16:24 Queue steve
2001-12-01 19:32 ` Jeffrey Carter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-11-27  1:19 Queue steve
2001-11-27  2:07 ` Queue Larry Kilgallen
2001-11-27 19:30   ` Queue Ted Dennison
2001-11-27 19:45     ` Queue Marin David Condic
2001-11-27 20:29       ` Queue Matthew Heaney
2001-11-27 20:55         ` Queue Marin David Condic
2001-11-27 21:20           ` Queue Ehud Lamm
2001-11-27 22:13             ` Queue Marin David Condic
2001-11-27 22:35               ` Queue Ehud Lamm
2001-11-28 14:53                 ` Queue Marin David Condic
2001-11-27 21:38         ` Queue Brian Rogoff
2001-11-28  8:07           ` Queue Mats Karlssohn
2001-11-30  4:49             ` Queue Brian Rogoff
2001-11-30 15:30               ` Queue Ted Dennison
2001-11-30 21:02                 ` Queue Ehud Lamm
2001-11-30 21:07               ` Queue Ehud Lamm
2001-11-28  8:28           ` Queue Thomas Wolf
2001-11-28 17:27           ` Queue Ted Dennison
2001-11-30 22:11             ` Queue Ehud Lamm
2001-11-28  8:01         ` Queue Mats Karlssohn
2001-11-28  7:48       ` Queue Mats Karlssohn
2001-11-28 15:39         ` Queue Marin David Condic
2001-11-29  7:35           ` Queue Mats Karlssohn
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox