diff options
| author | leiyu3 <s444814187@gmail.com> | 2022-09-13 18:11:37 -0400 |
|---|---|---|
| committer | leiyu3 <s444814187@gmail.com> | 2022-09-13 18:11:37 -0400 |
| commit | e5efa02c2746a4207251daf0173b4808dd087e89 (patch) | |
| tree | e26425c1d27e45ffaa10cfb91675100a0de53908 /readme.md | |
| download | linked_list_c-e5efa02c2746a4207251daf0173b4808dd087e89.tar.gz linked_list_c-e5efa02c2746a4207251daf0173b4808dd087e89.zip | |
init
Diffstat (limited to 'readme.md')
| -rw-r--r-- | readme.md | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..c302e1b --- /dev/null +++ b/readme.md | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | # Linked List in C | ||
| 2 | This is a c library for linked list done as a learning project. | ||
| 3 | |||
| 4 | The nodes stores integer values but can be switched to store any data you desire. | ||
| 5 | |||
| 6 | Hopefully by viewing the source code you can learn how different operations on the linked list is implemented. | ||
| 7 | |||
| 8 | # What has been implemented? | ||
| 9 | |||
| 10 | First initialize your linked list like so: | ||
| 11 | |||
| 12 | ```c | ||
| 13 | node* ll = malloc(sizeof(node)); | ||
| 14 | ll->value = 1; | ||
| 15 | ll->next = NULL; | ||
| 16 | ``` | ||
| 17 | |||
| 18 | Then the following functions are available for you to interact with the linked list. | ||
| 19 | |||
| 20 | These are the functions available in the header file. | ||
| 21 | |||
| 22 | ```c | ||
| 23 | int count_ll(node* ptr); | ||
| 24 | void prepend_ll(node **ptr, int value); | ||
| 25 | void append_ll(node* ptr, int value); | ||
| 26 | void print_ll(node* ptr); | ||
| 27 | void free_ll(node* ptr); | ||
| 28 | int update_node(node* ptr, int index, int value); | ||
| 29 | int delete_node(node **ptr, int index); | ||
| 30 | int get_value(node *ptr, int index); | ||
| 31 | node* search_node(node *ptr, int value); | ||
| 32 | void reverse_ll(node **ptr); | ||
| 33 | ``` | ||
