C Data Structures Library is a comprehensive library for C, offering a collection of data structures, algorithms, and utilities. It simplifies the use of essential data structures, sorting algorithms, and string manipulations, allowing you to focus on developing your application.
- Prebuilt Data Structures: Includes major data structures such as Linked Lists, Stacks, Queues etc.
- Algorithms: Implements a range of sorting and searching algorithms like Bubble Sort, Merge Sort, Quick Sort, Linear Search, and many more.
- Custom String Utilities: Provides a custom
Stringtype with dynamic resizing and various utility functions similar tostd::stringin C++. - Custom Functions: Each data structure and algorithm comes with a set of commonly used operations (e.g., insert, delete, search, traverse) tailored for ease of use.
- Header-Only Access: Include the relevant header files in your project to start using the data structures, algorithms, and utilities without additional setup.
- String
- String create();
- void freeS(String *str);
- void appendS(String *str, const char* suffix);
- size_t lenghtS(const String *str);
- const char* getS(const String *str);
- void readS(String *str);
- bool isemptyS(const String* str);
- void rep_substring(String *str, const char *old_sub, const char *new_sub);
- void reverseS(String *str);
- Linked List
- Node* CreateList(int data);
- void InsertAtHead(Node** head, int data);
- void InsertAtTail(Node** head, int data);
- void InsertAtPosition(Node** head, int data, int position);
- void DeleteByValue(Node** head, int data);
- void DeleteAtPosition(Node** head, int position);
- void DeleteList(Node** head);
- void PrintList(Node* head);
- int SearchList(Node* head, int data);
- int LengthList(Node* head);
- void SortList(Node** head);
- Generic Stack
- Stack *stackCreate(size_t element_size);
- void stackDelete(Stack *stack);
- bool stackPush(Stack *stack, const void *element);
- bool stackPop(Stack *stack);
- bool stackPeek(const Stack *stack, void *element);
- bool stackIsEmpty(const Stack *stack);
- Generic Queue
- Queue *queueCreate(size_t element_size);
- void queueDelete(Queue *queue);
- bool queueEnqueue(Queue *queue, const void *element);
- bool queueDequeue(Queue *queue);
- bool queuePeek(const Queue *queue, void *element);
- bool queueIsEmpty(const Queue *queue);
- Linear Search
- Binary Search
- Bubble Sort
- Insertion Sort
- Selection Sort
- Merge Sort
- Quick Sort
- Include the necessary header files in your C code.
- Initialize and use the data structures and algorithms as needed.
- Refer to the documentation in the code comments for detailed usage instructions.