From: Simon Wright <simon@pushface.org>
Subject: Re: Queue implementation in Ada
Date: Tue, 28 Oct 2014 19:25:20 +0000
Date: 2014-10-28T19:25:20+00:00 [thread overview]
Message-ID: <lyvbn4vvxb.fsf@pushface.org> (raw)
In-Reply-To: m2ona2$tv6$2@dont-email.me
Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org> writes:
> 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.
Good point.
I've been put off Doubly_Linked_Lists because I would usually have been
quite happy with singly linked lists. But really, what difference does
it make if all you're doing is implementing a Queue!
next prev parent reply other threads:[~2014-10-28 19:25 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
2014-10-28 19:25 ` Simon Wright [this message]
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