Hi Bruno, [...]
> > I don't see, however, to implement the function dealing with > > end of the list in O(1) behavior when the underlying data structure is > > a linked list. > > The LINKED list implementation is a doubly-linked list, and the functions > get_at, set_at, or remove_at are implemented like this: > If position < length/2 then > walk from the start of the list (O(position)) > else > walk from the end of the list (O(length-position)). > > So, the original invocation > gl_list_remove_at (list, gl_list_size (list) - 1) > already does the job in O(1). Great. (Now that you say it I think I have once looked into the code but forgotten the details.) It would be nice if this could be documented. In any case, the general six functions we discussed should then be possible without any implementation-specifics.