Linked lists in C, with open source ADT
xanthu.com
Linked lists in C, with open source ADT
1–10 of 43 posts
Re: Linked lists in C, with open source ADT
#2Re: Linked lists in C, with open source ADT
#3This is week-one stuff of a CS degree or on the job training. If you don't know this you shouldn't be programming.
Re: Linked lists in C, with open source ADT
#4Re: Linked lists in C, with open source ADT
#5You are, for whatever it's worth, better off defaulting to a variable-length array than to a linked list.
Re: Linked lists in C, with open source ADT
#6This is week-one stuff of a CS degree or on the job training. If you don't know this you shouldn't be programming.
Not everyone went to university, and people have to learn from somewhere. It is also only an introduction, there will be more complicated data structures shown soon, and algorithms. No point in jumping into the heavier stuff. Trying to help people who are new to C.
Re: Linked lists in C, with open source ADT
#7The book _C Interfaces and Implementation_ is nothing but library interfaces like this and their implementations. You are, for whatever it's worth, better off defaulting to a variable-length array than to a linked list.
Re: Linked lists in C, with open source ADT
#8This is week-one stuff of a CS degree or on the job training. If you don't know this you shouldn't be programming.
Not everyone went to university, and people have to learn from somewhere. It is also only an introduction, there will be more complicated data structures shown soon, and algorithms. No point in jumping into the heavier stuff. Trying to help people who are new to C.
Re: Linked lists in C, with open source ADT
#91. Please align the asterisks properly. It hurts eyes.
2. Access by index?
3. Iterator (callback on each element)
4. use 'init' instead of 'initialize'. Extra typing hurts fingers.
Re: Linked lists in C, with open source ADT
#10I prefer to store next/prev pointers with the data itself, and to use offsetof/containerof to find a pointer to the data struct which contains a given set of next/prev pointers.
One example of such an scheme is the list used in the Linux kernel: