comp.lang.ada
 help / color / mirror / Atom feed
From: Ole-Hjalmar Kristensen <ohk@clustra.com>
Subject: Re: Ada Queue
Date: 2000/04/07
Date: 2000-04-07T00:00:00+00:00	[thread overview]
Message-ID: <umqu2heibr0.fsf@gong2.clustra.com> (raw)
In-Reply-To: 38ed0123@news.hamilton.edu

"Joseph T." <thisthat7@hotmail.com> writes:

> Yes...I am looking for that techincal discussion...you're so slick.  =)
> 
> Let me ask you this...how come then, did the author of this page ( a CS professor
> ) choose the same method shown here:
> 
> http://www.cm.cf.ac.uk/Dave/C/node11.html
> 
> I think that the Ada replicates the method in C used by this professor. 
> Does his code suffer from the same things you mentioned?
> 

It would perhaps have been clearer for the reader to use a temporary
variable to iterate, but there are no other drawbacks associated with
his method, which is indeed a very common way of doing it in C.

But the algorithms can be made simpler (but perhaps not clearer) by
using a pointer to a pointer instead of a simple pointer.
For example, the AddItem code can be made much simpler by defining it
as listelement * AddItem (listelement ** listpointer, int data);
How to simplify the body of the function is left as an exercise to the
reader :-)

> Thanks so much.
> 

-- 
E pluribus Unix




  parent reply	other threads:[~2000-04-07  0:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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     ` 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-06  0:00     ` Ted Dennison
2000-04-06  0:00       ` Joseph T.
2000-04-07  0:00         ` Ted Dennison
2000-04-07  0:00           ` Hyman Rosen
2000-04-07  0:00         ` Ole-Hjalmar Kristensen [this message]
2000-04-07  0:00           ` Joseph T
2000-04-07  0:00             ` Ted Dennison
2000-04-07  0:00 ` Simon Wright
2000-04-09  0:00   ` Robert Dewar
2000-04-07  0:00 ` MaggieJohn
2000-04-07  0:00   ` Ted Dennison
replies disabled

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