From caa60ca993d1659b38cbcd441ad9e31b68181bf9 Mon Sep 17 00:00:00 2001 From: leiyu3 Date: Thu, 22 Sep 2022 12:33:41 -0400 Subject: fixes --- linked_list_test.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'linked_list_test.c') 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 @@ #include "linked_list.h" int main(){ - - node* ll = malloc(sizeof(node)); - ll->value = 1; - ll->next = NULL; - - + // should I make it so that when you make a node you have to first initialize it with a value? + // this means that we essentially can not have an empty list. + + // NULL will count as an empty list + struct node* ll = init_ll(1); + + /* prepend_ll(&ll, 1); */ + printf("%d\n",count_ll(ll)); print_ll(ll); - reverse_ll(&ll); - print_ll(ll); - /* delete_node(&ll, 0); */ - - /* print_ll(ll); */ - /* printf("The length of ll is %d\n", count_ll(ll)); */ - - /* delete_node(&ll, 0); */ - /* print_ll(ll); */ - /* printf("The length of ll is %d\n", count_ll(ll)); */ - /* printf("%d\n", search_node(ll, 10)->value); */ + /* delete_node(&ll,0); */ - /* printf("%d\n", get_value(ll, 3)); */ + /* printf("%d\n",count_ll(ll)); */ - /* free_ll(ll); */ + free_ll(ll); return 0; } -- cgit v1.2.3