Re: Linked Lists

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Monday 13 August 2001 08:57, Derek Parnell wrote:

> From: "Chris Bensler" <bensler at telus.net>

> Subject: Linked Lists
>
> >     can someone tell what a linked list is?

Good answer from Derek. I'll just add, Chris, since I know you 
sometimes use GTK, that GLib has single and doubly-linked 
lists "ready to use", and they work much like Euphoria sequences:

object myList 

myList = NULL -- must assign a null pointer

myList = g_list_append(myList,"Some Stuff")
etc... also available is g_list_prepend.

myList = g_list_insert(myList,"More Stuff in the middle",1)
easier than Euphoria.  note: the number is zero based, so 
element 0 is the first on the list, etc.

There's also a g_list_sort(list,sortfunction),  like custom_sort, 
and a g_list_insert_sorted, which inserts in the correct place 
to maintain the sort order., as well as g_list_find, which does 
what you would expect it to. Probably some other stuff as well,
but my book doesn't list them.

Regards,
Irv

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu