comp.lang.ada
 help / color / mirror / Atom feed
* Ada Queue
@ 2000-04-06  0:00 Joseph T.
  2000-04-06  0:00 ` Ted Dennison
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Joseph T. @ 2000-04-06  0:00 UTC (permalink / raw)



Can anyone corroborate why I chose to make this enqueue function using the
passed pointer to Q instead of the temp pointer to loop through the queue?
 Any suggestions, ideas, compliments, critiques are greatly appreciated.
 Please help.

procedure Enqueue(Q: in out Queue; E : Element_type) is
   New_Queue : Queue;

begin
   if Q /= null then
       New_Queue := Q;
       while Q.Rest /= null loop
          Q := Q.Rest;
       end loop;
       Q.Rest := new QueueNode;
       Q := Q.Rest;
       Q.Data := E;
       Q.Rest := null;
       Q := New_Queue;
   else
       Q := new QueueNode;
       Q.Data := E;
       Q.Rest := null;
   end if;
end Enqueue;




^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2000-04-09  0:00 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-06  0:00 Ada Queue Joseph T.
2000-04-06  0:00 ` Ted Dennison
2000-04-06  0:00   ` Joseph T
2000-04-06  0:00     ` tmoran
2000-04-08  0:00       ` tmoran
2000-04-06  0:00     ` Ted Dennison
2000-04-06  0:00       ` Joseph T.
2000-04-07  0:00         ` Ole-Hjalmar Kristensen
2000-04-07  0:00           ` Joseph T
2000-04-07  0:00             ` Ted Dennison
2000-04-07  0:00         ` Ted Dennison
2000-04-07  0:00           ` Hyman Rosen
2000-04-06  0:00     ` Robert Dewar
2000-04-06  0:00       ` Ted Dennison
2000-04-06  0:00       ` Joseph T
2000-04-07  0:00         ` Ole-Hjalmar Kristensen
2000-04-07  0:00 ` MaggieJohn
2000-04-07  0:00   ` Ted Dennison
2000-04-07  0:00 ` Simon Wright
2000-04-09  0:00   ` Robert Dewar

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