Owen Taylor <> writes:

> GLib-1.3 already includes a GQueue data structure which does
> this.

I have a few problems with the GQueue from 1.3.

(a) It is not opaque. I think data structures almost always should be

(b) The names of the operations are different from those of GList's
    and GSList's.

(c) Its set of operation is not as complete as GS?List's.

(d) Since it supports adding and deleting in both ends, it should be
    called a GDeque.

(e) It would be easy to replace it with a priority queue supporting
    not only O(1) inserting and removing from the ends, but also
    O(log n) sorted inserting. Well, perhaps not easy, but at least
    not very difficult.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]