Re: [gtk-list] Re: g_list_append is O(n^2)
- From: Federico Mena Quintero <federico nuclecu unam mx>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: g_list_append is O(n^2)
- Date: Thu, 15 Oct 1998 12:29:45 -0400
> sorry for the confusion. STL has constant time at least for push_back()
> and push_front(), while glib has constant time for g_list_prepend()
> but linear time for g_list_append(). It has to go through the whole
> list in g_list_last().
Glib lists work pretty much like Lisp lists.
Applications which require O(1) append/prepend times use the "keep
pointers to the list start and end" method -- you can look at the
GnomeCanvas, GtkCList, etc.
Federico
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]