Tag: list

Doubly Linked List API in C

Happy New Year to all,

I’m posting to share an update to my Doubly Linked List API (or shorter, DLL-API) in C.

First things first, if you haven’t visited my personal website (here) (where I’ve listed some of my projects), I have implemented a Doubly Linked List API in C, that can be obviously used with any datatype, as long as a specific set of functions is provided (copy, allocate, etc.).

I’ve updated the API to version 2.1 and among the updates, one that is important, is the implementation of iterator functionality.

Here’s the brief changelog from the README:

Changelog

1. Added support for iterators (look below for more info)
2. Changed ugly dllistptr to a more [user and C]-friendly naming convention, that is list_t (important)
3. Renamed the API files to a more C-like naming convention, like this: doubly_linked_list_adt.c/h
4. Updated demo to include some of the iterator functionality
5. This version was extensively tested with a multithreaded project, that used the list with about 10 datatypes
6. Added a copy-constructor-like method to copy lists
7. Binary search to access find the associated element in the list of iterators
8. In big programs, compile with -O2 or -O3 to see the magic

This API was heavily used in a reverse search engine project with many many lists, and has proved to be solid!

You can find the Doubly Linked List API here!

If there are any suggestions or issues with the API, don’t hesitate to submit a pull request or an issue!