63 int list_size = list->
size_;
67 for (
int i = 0; i < list_size; i++)
69 current_node = list->
last_;
92 if (current_node == NULL)
97 if (current_node == node_to_check)
123 if (list->
size_ == 0)
141 if (list->
size_ == 0)
154 list_to_append->
first_ = NULL;
155 list_to_append->
last_ = NULL;
156 list_to_append->
size_ = 0;
166 if (list->
size_ == 0)
179 else if (node->
next_ == NULL)
213 while (current_node != NULL)
215 if (current_node->
data_ == data)
217 if (current_node == list->
first_)
225 if (current_node == list->
last_)
237 if(list->
last_ != NULL)
244 current_node->
next_ = NULL;
247 current_node = current_node->
next_;
257 if (list->
size_ == 0)
275 while (current_node != NULL)
278 printf(
"List element %d, value: %d\n", count, current_node->
data_);
279 current_node = current_node->
next_;
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)