diff options
Diffstat (limited to 'linked_list.h')
| -rw-r--r-- | linked_list.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/linked_list.h b/linked_list.h index 1b2c3ca..40df9d7 100644 --- a/linked_list.h +++ b/linked_list.h | |||
| @@ -1,22 +1,22 @@ | |||
| 1 | #ifndef __LINKED_LIST_H__ | 1 | #ifndef __LINKED_LIST_H__ |
| 2 | #define __LINKED_LIST_H__ | 2 | #define __LINKED_LIST_H__ |
| 3 | 3 | ||
| 4 | typedef struct node node; | ||
| 5 | struct node{ | 4 | struct node{ |
| 6 | int value; | 5 | int value; |
| 7 | node* next; | 6 | struct node* next; |
| 8 | }; | 7 | }; |
| 9 | 8 | ||
| 10 | int count_ll(node* ptr); | 9 | int count_ll(struct node* ptr); |
| 11 | void prepend_ll(node **ptr, int value); | 10 | struct node* init_ll(int value); |
| 12 | void append_ll(node* ptr, int value); | 11 | void prepend_ll(struct node **ptr, int value); |
| 13 | void print_ll(node* ptr); | 12 | void append_ll(struct node* ptr, int value); |
| 14 | void free_ll(node* ptr); | 13 | void print_ll(struct node* ptr); |
| 15 | int update_node(node* ptr, int index, int value); | 14 | void free_ll(struct node* ptr); |
| 16 | int delete_node(node **ptr, int index); | 15 | int update_node(struct node* ptr, int index, int value); |
| 17 | int get_value(node *ptr, int index); | 16 | int delete_node(struct node **ptr, int index); |
| 18 | node* search_node(node *ptr, int value); | 17 | int get_value(struct node *ptr, int index); |
| 19 | void reverse_ll(node **ptr); | 18 | struct node* search_node(struct node *ptr, int value); |
| 19 | void reverse_ll(struct node **ptr); | ||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | #endif | 22 | #endif |
