no queue class in base?
Matej Košík
kosik at fiit.stuba.sk
Thu Nov 3 21:15:58 UTC 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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.
Regards
- --
Matej Košík
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDan4Nj6wbCo2ZNGIRAtr5AJ4/jSLOi4lXkRkQ+Xy/kHKB4bW36gCcCecb
0rksjOC/KS18W9+W0I1DimU=
=obFl
-----END PGP SIGNATURE-----
More information about the Squeak-dev
mailing list
|