Re: Advanced data structures in Glib ?



Zack Rusin <zackrat att net> writes:

> Hi,
> 
> I was wondering if there's a chance of seeing a little more advanced data 
> structures in the next release of Glib. To be more specific, I think it 
> would be really beneficial to see:
> - Red Black tree moved from GTK+ to Glib,
> - Hash table with collision resolution (linked list preferably),
> - B-Tree (come on you know you want it :) ),
> - Splay tree, 
> - priority queue, 
> added to Glib. What do you guys think?

The question that needs to be asked for each proposed data structure
addition is:

 - Why would someone want to use the data structure as opposed to one
   already in GLib.

GLib is not in the business of providing particular data structures, 
but  in the business of providing abstract data types that are useful
for programs.

So, for instance, as far as I know there is no particular reason why
you'd want both RB trees and the current AVL GTree... while there
may be specific tradeoffs between the two types of trees:

 - The set of available operations is the same.

 - In general an operation that would be fast with one would be
   fast with the other, and an operation slow with one, slow with
   the other.
 
 - Almost no programmers would be qualified to choose between them.

If RBTrees were really vastly better than AVL trees, then we should
just replace GTree with them..



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