comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Queue implementation in Ada
Date: Tue, 28 Oct 2014 11:29:28 -0700
Date: 2014-10-28T11:29:28-07:00	[thread overview]
Message-ID: <m2ona2$tv6$2@dont-email.me> (raw)
In-Reply-To: <lyk33k7btz.fsf@pushface.org>

On 10/28/2014 03:00 AM, Simon Wright wrote:
> Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org> writes:
> 
>> If you want unsynchronized queues, you could build your own, possibly
>> using Ada.Containers.Doubly_Linked_Lists (ARM A.18.3).
> 
> I used Vectors, ARM A.18.2. Not sure why one would choose one over the
> other?

In the sense that both are random-access sequences, with essentially the same
interface, there is none. One could build either as a wrapper around the other.

Clearly any difference must be in the implementation. Given that one is named
Doubly_Linked_Lists and the other adds index-based access, it's reasonable to
think that the former is expected to be implemented as a linked list and the
latter as an array. Since a queue experiences frequent additions to the tail and
frequent deletions from the head, the linked list seems appropriate.

-- 
Jeff Carter
"My mind is a raging torrent, flooded with rivulets of
thought, cascading into a waterfall of creative alternatives."
Blazing Saddles
89


  reply	other threads:[~2014-10-28 18:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-28  2:01 Queue implementation in Ada compguy45
2014-10-28  3:30 ` Jeffrey Carter
2014-10-28 10:00   ` Simon Wright
2014-10-28 18:29     ` Jeffrey Carter [this message]
2014-10-28 19:25       ` Simon Wright
2014-10-28 20:27         ` Dmitry A. Kazakov
2014-10-28 21:27           ` Simon Wright
2014-10-28  8:29 ` Dmitry A. Kazakov
2014-10-28  9:56 ` Simon Wright
2014-10-28 13:16 ` Brad Moore
replies disabled

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