|
C_Algorithms 2.0.0
Documentation
|
#include <stdio.h>#include <stdlib.h>#include <stdbool.h>

Go to the source code of this file.
Data Structures | |
| struct | _Node_ |
| struct | _List_ |
Typedefs | |
| typedef struct _Node_ | Node |
| typedef struct _List_ | List |
Functions | |
| Node * | createNode (void) |
| Allocates memory for a new node and initalizes it. | |
| bool | freeNode (Node *node) |
| Frees the memory of a node. | |
| List * | createList (void) |
| Allocates memory for a new list and initalizes it. | |
| bool | freeList (List *list) |
| Frees the memory of a list and all nodes in it. | |
| Node * | appendNodeToEndOfList (List *list, Node *node, bool check_for_existing_node) |
| Append a node to the end of a list. | |
| List * | appendListToEndOfList (List *list, List *list_to_append) |
| bool | removeNodeFromList (List *list, Node *node) |
| Removes a node from the list. | |
| Node * | removeNodeWithValue (List *list, int data) |
| Remove a node from a list with a specific value of playing_card_. | |
| 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) | |
| void | printList (List *list) |
| Print the whole List without trailing . | |
Definition at line 11 of file doublyLinkedList.h.
Definition at line 10 of file doublyLinkedList.h.
Definition at line 139 of file doublyLinkedList.c.
References _List_::first_, _List_::last_, _Node_::next_, _Node_::previous_, and _List_::size_.
Append a node to the end of a list.
| list | Address of the list to append to |
| node | Address of the node |
| check_for_existing_node | true: same node can only be saved once | false: the same node can be saved multiple times |
Definition at line 115 of file doublyLinkedList.c.
References checkElementInList(), _List_::first_, _List_::last_, _Node_::next_, _Node_::previous_, and _List_::size_.
Referenced by FunctionCall().


Checks if the adress of a node is already in a list (rekursive)
| current_node | Address of the node to begin the check |
| node_to_check | The address of the node to check |
Definition at line 89 of file doublyLinkedList.c.
References checkElementInList(), and _Node_::next_.
Referenced by appendNodeToEndOfList(), and checkElementInList().


| List * createList | ( | void | ) |
Allocates memory for a new list and initalizes it.
Definition at line 38 of file doublyLinkedList.c.
References _List_::first_, _List_::last_, and _List_::size_.
Referenced by FunctionCall().

| Node * createNode | ( | void | ) |
Allocates memory for a new node and initalizes it.
Definition at line 6 of file doublyLinkedList.c.
References _Node_::data_, _Node_::next_, and _Node_::previous_.
Referenced by FunctionCall().

| bool freeList | ( | List * | list | ) |
Frees the memory of a list and all nodes in it.
| list | Address to a List struct |
Definition at line 56 of file doublyLinkedList.c.
References freeNode(), _List_::last_, removeNodeFromList(), and _List_::size_.
Referenced by FunctionCall().


| bool freeNode | ( | Node * | node | ) |
Frees the memory of a node.
| node | Address to a Node struct |
Definition at line 25 of file doublyLinkedList.c.
Referenced by freeList().

| void printList | ( | List * | list | ) |
Print the whole List without trailing
.
| list | List to be printed |
Definition at line 271 of file doublyLinkedList.c.
References _Node_::data_, _List_::first_, and _Node_::next_.
Referenced by FunctionCall().

Remove first node in list.
| list |
Definition at line 255 of file doublyLinkedList.c.
References _List_::first_, _Node_::next_, and _List_::size_.
Removes a node from the list.
| list | Address of the list |
| node | Address of node which should be removed |
Definition at line 164 of file doublyLinkedList.c.
References _List_::first_, _List_::last_, _Node_::next_, _Node_::previous_, and _List_::size_.
Referenced by freeList().

Remove a node from a list with a specific value of playing_card_.
| list | List where the node should be removed |
| value | Value of playing_card_ that should be removed |
Definition at line 210 of file doublyLinkedList.c.
References _Node_::data_, _List_::first_, _List_::last_, _Node_::next_, _Node_::previous_, and _List_::size_.