bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* Add gl_list_remove_last to list/xlist
@ 2020-04-28  7:08 Marc Nieper-Wißkirchen
  2020-05-02  0:07 ` Bruno Haible
  0 siblings, 1 reply; 42+ messages in thread
From: Marc Nieper-Wißkirchen @ 2020-04-28  7:08 UTC (permalink / raw)
  To: bug-gnulib

This is a feature request to add an operation

extern gl_list_node_t gl_list_remove_last (gl_list_t list)

to the list/xlist interface.

This operation would remove the last element of the list and return
the node of the previous element (or NULL if no element remained).

There are at least two reasons why adding such an operation is meaningful:

(1) It is a common operation if the list is used as a stack. Pushing
will be gl_list_add_last, popping will be gl_list_remove_last.

(2) The complexity of removing an arbitrary element in an ARRAY list
is O(n). Removing the last element, however, is only O(1). With an
explicit operation gl_list_remove_last, this can be documented in the
table at the beginning of lib_gl_list.h.

Thanks,

Marc


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2020-10-10 15:11 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28  7:08 Add gl_list_remove_last to list/xlist Marc Nieper-Wißkirchen
2020-05-02  0:07 ` Bruno Haible
2020-05-02  7:16   ` Marc Nieper-Wißkirchen
2020-05-02 12:07     ` Bruno Haible
2020-05-02 12:49       ` Marc Nieper-Wißkirchen
2020-05-02 15:49         ` Bruno Haible
2020-05-02 16:04           ` Marc Nieper-Wißkirchen
2020-05-22 15:59           ` Marc Nieper-Wißkirchen
2020-05-23 12:30             ` stack module Bruno Haible
2020-05-23 12:42               ` Marc Nieper-Wißkirchen
2020-05-23 14:02                 ` Bruno Haible
2020-05-23 14:36                   ` Marc Nieper-Wißkirchen
2020-05-23 15:39                     ` Paul Eggert
2020-05-23 15:55                       ` Marc Nieper-Wißkirchen
2020-05-23 16:44                         ` Paul Eggert
2020-05-23 16:54                           ` Marc Nieper-Wißkirchen
2020-05-23 17:33                             ` Paul Eggert
2020-05-23 17:38                               ` Marc Nieper-Wißkirchen
2020-05-23 20:51                                 ` Paul Eggert
2020-05-23 21:07                                   ` Marc Nieper-Wißkirchen
2020-05-23 22:06                                   ` Bruno Haible
2020-05-24  2:14                                     ` Paul Eggert
2020-05-24  8:17                                       ` Marc Nieper-Wißkirchen
2020-05-24 19:07                                         ` Paul Eggert
2020-05-24 19:26                                           ` Bruno Haible
2020-06-02 13:44                                             ` Marc Nieper-Wißkirchen
2020-05-23 17:19                     ` Bruno Haible
2020-07-22 20:17                       ` Marc Nieper-Wißkirchen
2020-07-23 10:36                         ` Bruno Haible
2020-07-23 10:56                           ` Marc Nieper-Wißkirchen
2020-10-07  9:01                           ` Marc Nieper-Wißkirchen
2020-10-07 11:31                             ` Marc Nieper-Wißkirchen
2020-10-10 14:06                               ` Bruno Haible
2020-10-10 14:35                                 ` Marc Nieper-Wißkirchen
2020-10-10 15:10                                   ` ChangeLog entries Bruno Haible
2020-05-02 21:24       ` Add gl_list_remove_last to list/xlist Bruno Haible
2020-05-03 11:14         ` Bruno Haible
2020-05-05  8:37         ` Marc Nieper-Wißkirchen
2020-05-08 17:28           ` Bruno Haible
2020-06-03 16:32         ` Marc Nieper-Wißkirchen
2020-06-03 21:08           ` Bruno Haible
2020-06-03 21:22             ` Marc Nieper-Wißkirchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).