1
1
mirror of https://github.com/theoludwig/libcproject.git synced 2024-11-09 14:51:30 +01:00
libcproject/lib/linked_list.h
2023-01-07 19:41:04 +01:00

33 lines
700 B
C

#ifndef __LINKED_LIST__
#define __LINKED_LIST__
#include <stdbool.h>
#include <stdlib.h>
#include "stack.h"
struct linked_list {
struct linked_list_node *head;
size_t length;
};
struct linked_list_node {
void *data;
struct linked_list_node *next;
};
struct linked_list *linked_list_initialization();
struct linked_list_node *linked_list_add_in_head(struct linked_list *list, void *new_value);
void linked_list_delete_in_head(struct linked_list *list);
struct linked_list_node *linked_list_add_after_last(struct linked_list *list, void *new_data);
struct linked_list *linked_list_reverse(struct linked_list *list);
void linked_list_reverse_mutate(struct linked_list *list);
#endif