diff options
Diffstat (limited to 'linked_list_test.c')
| -rw-r--r-- | linked_list_test.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/linked_list_test.c b/linked_list_test.c index a71a1ff..7fab681 100644 --- a/linked_list_test.c +++ b/linked_list_test.c | |||
| @@ -3,27 +3,19 @@ | |||
| 3 | #include "linked_list.h" | 3 | #include "linked_list.h" |
| 4 | 4 | ||
| 5 | int main(){ | 5 | int main(){ |
| 6 | 6 | // should I make it so that when you make a node you have to first initialize it with a value? | |
| 7 | node* ll = malloc(sizeof(node)); | 7 | // this means that we essentially can not have an empty list. |
| 8 | ll->value = 1; | 8 | |
| 9 | ll->next = NULL; | 9 | // NULL will count as an empty list |
| 10 | 10 | struct node* ll = init_ll(1); | |
| 11 | 11 | ||
| 12 | /* prepend_ll(&ll, 1); */ | ||
| 13 | printf("%d\n",count_ll(ll)); | ||
| 12 | print_ll(ll); | 14 | print_ll(ll); |
| 13 | reverse_ll(&ll); | 15 | /* delete_node(&ll,0); */ |
| 14 | print_ll(ll); | ||
| 15 | /* delete_node(&ll, 0); */ | ||
| 16 | |||
| 17 | /* print_ll(ll); */ | ||
| 18 | /* printf("The length of ll is %d\n", count_ll(ll)); */ | ||
| 19 | |||
| 20 | /* delete_node(&ll, 0); */ | ||
| 21 | /* print_ll(ll); */ | ||
| 22 | /* printf("The length of ll is %d\n", count_ll(ll)); */ | ||
| 23 | /* printf("%d\n", search_node(ll, 10)->value); */ | ||
| 24 | 16 | ||
| 25 | /* printf("%d\n", get_value(ll, 3)); */ | 17 | /* printf("%d\n",count_ll(ll)); */ |
| 26 | 18 | ||
| 27 | /* free_ll(ll); */ | 19 | free_ll(ll); |
| 28 | return 0; | 20 | return 0; |
| 29 | } | 21 | } |
