C_Algorithms 2.0.0
Documentation
Loading...
Searching...
No Matches
doublyLinkedList.h
Go to the documentation of this file.
1#ifndef DOUBLY_LINKED_LIST_H
2#define DOUBLY_LINKED_LIST_H
3
4#include <stdio.h>
5#include <stdlib.h>
6#include <stdbool.h>
7
8/*<-- TYPEDEF -->*/
9
10typedef struct _Node_ Node;
11typedef struct _List_ List;
12
13/*<-- STRUCTS -->*/
14
15struct _Node_
16{
19 int data_;
20};
21
22struct _List_
23{
26 int size_;
27};
28
29/*<-- FUNCTIONS -->*/
30
31Node *createNode(void);
32bool freeNode(Node *node);
33List *createList(void);
34bool freeList(List *list);
35Node *appendNodeToEndOfList(List *list, Node *node, bool check_for_existing_node);
36List *appendListToEndOfList(List *list, List *list_to_append);
37bool removeNodeFromList(List *list, Node *node);
38Node *removeNodeWithValue(List* list, int data);
39Node *remove_first(List *list);
40bool checkElementInList(Node *current_node, Node *node_to_check);
41void printList(List *list);
42
43#endif //DOUBLY_LINKED_LIST_H
Node * appendNodeToEndOfList(List *list, Node *node, bool check_for_existing_node)
Append a node to the end of a list.
Node * createNode(void)
Allocates memory for a new node and initalizes it.
Node * removeNodeWithValue(List *list, int data)
Remove a node from a list with a specific value of playing_card_.
bool removeNodeFromList(List *list, Node *node)
Removes a node from the list.
void printList(List *list)
Print the whole List without trailing .
bool freeNode(Node *node)
Frees the memory of a node.
bool freeList(List *list)
Frees the memory of a list and all nodes in it.
List * createList(void)
Allocates memory for a new list and initalizes it.
List * appendListToEndOfList(List *list, List *list_to_append)
Node * remove_first(List *list)
Remove first node in list.
bool checkElementInList(Node *current_node, Node *node_to_check)
Checks if the adress of a node is already in a list (rekursive)
Node * last_
Node * first_
Node * next_
Node * previous_