diff options
| author | Blake Romero <blake@blkrom.com> | 2024-09-19 18:09:18 +0100 |
|---|---|---|
| committer | Blake Romero <blake@blkrom.com> | 2024-10-30 10:13:26 +0000 |
| commit | 48e1ff994eff48b791541201217a3c73ca81947a (patch) | |
| tree | 49a21d3de1c69036160d2cd463b563bd542ce14a /demo/main.c | |
| parent | eb5730b438d15d99f4e38565d4e132a3faef994e (diff) | |
Move main.c to demo & update Makefile
Diffstat (limited to 'demo/main.c')
| -rw-r--r-- | demo/main.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/demo/main.c b/demo/main.c new file mode 100644 index 0000000..46fce13 --- /dev/null +++ b/demo/main.c @@ -0,0 +1,45 @@ +#include "../src/ll.h" + +int main() { + int val = 7; + Node* head = llnode(val); + /* printf("Init with %i:\t", val); */ + /* llprint(head); */ + + /* val = 12; */ + /* llpush(&head, val); */ + /* printf("Push %i:\t", val); */ + /* llprint(head); */ + + /* val = 99; */ + /* printf("Append %i:\t", val); */ + /* llappend(head,val); */ + /* llprint(head); */ + + /* val = 45; */ + /* printf("Insert %i:\t", val); */ + /* llinsert(&head, val, 2); */ + /* llprint(head); */ + + /* val = 42; */ + /* printf("Insert %i:\t", val); */ + /* llinsert(&head, val, 1); */ + /* llprint(head); */ + + /* printf("Pop %i:\t\t", llpop(&head)); */ + /* llprint(head); */ + + /* printf("Remove %i:\t",llrmlast(&head)); */ + /* llprint(head); */ + + /* printf("Remove %i:\t",llrm(&head,1)); */ + /* llprint(head); */ + + /* llvprint(head); */ + + head->next = llnode(14); + head->next->next = llnode(22); + llfree(&head); + llprint(head); + printf("Length: %i\n", lllength(head)); +} |
