aboutsummaryrefslogtreecommitdiff
path: root/linked_list_test.c
diff options
context:
space:
mode:
authorleiyu3 <s444814187@gmail.com>2022-09-22 12:33:41 -0400
committerleiyu3 <s444814187@gmail.com>2022-09-22 12:33:41 -0400
commitcaa60ca993d1659b38cbcd441ad9e31b68181bf9 (patch)
treef48bebaddb1176de91cc3391b0aa597f952b94bf /linked_list_test.c
parentaac6ac4afc6d919771c2c342d85be565a26ba013 (diff)
downloadlinked_list_c-caa60ca993d1659b38cbcd441ad9e31b68181bf9.tar.gz
linked_list_c-caa60ca993d1659b38cbcd441ad9e31b68181bf9.zip
fixes
Diffstat (limited to 'linked_list_test.c')
-rw-r--r--linked_list_test.c30
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
5int main(){ 5int 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}