C Workshop
|
Functions | |
List * | CreateList () |
Create a List object. More... | |
void | FreeList (List *list) |
Free all memory allocated for the list. More... | |
size_t | GetListSize (List *list) |
Get the size of the list. More... | |
Node * | GetListHead (List *list) |
Get the list's head. More... | |
Node * | GetNextNode (Node *currentNode) |
Get the next node for the given node. More... | |
ListDataType | GetValue (Node *node) |
Get the value of the Node. More... | |
Node * | Insert (Node *after, ListDataType newValue) |
Inserts a new node after the given node. More... | |
Node * | PushFront (List *list, ListDataType newValue) |
Appends a new node to the head of the list. More... | |
Node * | PushBack (List *list, ListDataType newValue) |
Append a new node to the end of the list. More... | |
ListDataType | PopFront (List *list) |
Removes the node from the front of the list. More... | |
ListDataType | PopBack (List *list) |
Removes the node from the end of the list. More... | |
void | DeleteNode (List *list, Node *target) |
Delete node from list given node. More... | |
Node * | DeleteValue (List *list, ListDataType value) |
Deletes a node from the list given the value. More... | |
Node * | Find (List *list, ListDataType value) |
Finds the first node with the given value. More... | |
List* CreateList | ( | ) |
Create a List object.
Delete node from list given node.
list | The list to delete node from |
target | The node to delete |
Node* DeleteValue | ( | List * | list, |
ListDataType | value | ||
) |
Deletes a node from the list given the value.
list | The list to delete the node from. |
value | The value of the node to delete. |
Node* Find | ( | List * | list, |
ListDataType | value | ||
) |
Finds the first node with the given value.
list | The list to search. |
value | The value to search for. |
void FreeList | ( | List * | list | ) |
Free all memory allocated for the list.
list | The List to be freed. |
Get the list's head.
list | The list |
size_t GetListSize | ( | List * | list | ) |
Get the size of the list.
list | The list to get the size of |
Get the next node for the given node.
currentNode | The node to get the next node for |
ListDataType GetValue | ( | Node * | node | ) |
Get the value of the Node.
node | The Node to get the value from |
Node* Insert | ( | Node * | after, |
ListDataType | newValue | ||
) |
Inserts a new node after the given node.
after | The node after which the new node is inserted. |
newValue | The value of the new node. |
ListDataType PopBack | ( | List * | list | ) |
Removes the node from the end of the list.
list | The list to remove the node from. |
ListDataType PopFront | ( | List * | list | ) |
Removes the node from the front of the list.
list | The list to remove the node from. |
Node* PushBack | ( | List * | list, |
ListDataType | newValue | ||
) |
Append a new node to the end of the list.
list | The list to append to |
newValue | The value to append |
Node* PushFront | ( | List * | list, |
ListDataType | newValue | ||
) |
Appends a new node to the head of the list.
list | The list to append to. |
newValue | The value to append. |