no queue class in base?

Martin Kuball martinkuball at web.de
Fri Nov 4 18:22:09 UTC 2005


Am Thursday, 3. November 2005 22:15 schrieb Matej Košík:
> Martin Kuball wrote:
> > Hi!
> >
> > I'm looking for a queue class in squeak. The only class I found
> > is SharedQueue. But I don't need synchronization. Sure, if there
> > is really none I could write one in minutes. But I wonder if it
> > makes sense to add such an elementary data structure to the base
> > collection stuff.
> >
> > Martin
>
> Hi,
>
> Two years ago I needed a linked list whose operations for adding
> and removing elements have O(1) time complexity. LinkedList,
> unfortunatelly, is not the case.
>
> I have implemented its bidirectional variant. It is package as
> `BidirectionalLinkedList' and available on SqueakMap.
>
> I have tested it and used it a lot. It has similar disadvantages as
> LinkedList. Only elements subclassed from `BidirectionalLink' could
> be part of the list. This, in case of single inheritance, may be
> very uncomfortable. But in my cases it was no problem.
>
> (of course, it is not "thread-safe")
>
> Maybe you will find it useful.

Thanks for your answers. I implementend a quick hack based on Linked 
List. But given the fact the performance ist not an issue for me, 
using OrderedCollection might be worth a try.

Martin





More information about the Squeak-dev mailing list