diff options
| author | Blake Romero <blake@blkrom.com> | 2024-09-18 00:32:53 +0100 |
|---|---|---|
| committer | Blake Romero <blake@blkrom.com> | 2024-10-30 10:13:26 +0000 |
| commit | 45c1fbf4dfe5c7a7243b625eb8a600bdce6c748f (patch) | |
| tree | 0c19f2d45941d2027ae5f07586af4bd427a5cdf6 /linkedlist/ll.h | |
| parent | d1841d4d2a087d1681d1fb483301b4a7e4722f98 (diff) | |
Add makefile & tests
Diffstat (limited to 'linkedlist/ll.h')
| -rw-r--r-- | linkedlist/ll.h | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/linkedlist/ll.h b/linkedlist/ll.h deleted file mode 100644 index 0e15c43..0000000 --- a/linkedlist/ll.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef LL -#define LL - -#define NEW_NODE llnode(); - -#include <stdio.h> -#include <stdlib.h> - -// Node -typedef struct Node { - int value; - struct Node* next; -} Node; - -// Create & initialise a new node -Node* llnode(); - -// Print linked list values -// O() -void llprint(Node* head); -void llvprint(Node* head); - -// Return number of nodes in list -// O(n) -int llcount(Node* head); - -// Append value to the end of the list -// O(n) -void llappend(Node* head, int value); - -// Prepend a value to the list -// O(1) -void llpush(Node** head, int value); - -// Insert a value to the list at index -// O(n) -void llinsert(Node** head, int value, int index); - -// Free nodes from memory -void llfree(Node* head); - -// Pop (remove) first node -// O(1) -int llpop(Node** head); - -// Remove last node -// O(n) -int llrmlast(Node** head); - -// Remove node at index -// O(n) -int llrm(Node** head, int index); - -#endif //LL |
