File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
0x13-more_singly_linked_lists Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ #ifndef LISTS_H
2+ #define LISTS_H
3+
4+ #include <stdlib.h>
5+ #include <string.h>
6+ #include <stdio.h>
7+
8+
9+ /**
10+ * struct listint_s - singly linked list
11+ * @n: integer
12+ * @next: points to the next node
13+ *
14+ * Description: singly linked list node structure
15+ */
16+ typedef struct listint_s
17+ {
18+ int n ;
19+ struct listint_s * next ;
20+ } listint_t ;
21+
22+ size_t print_listint (const listint_t * h );
23+ size_t listint_len (const listint_t * h );
24+ listint_t * add_nodeint (listint_t * * head , const int n );
25+ listint_t * add_nodeint_end (listint_t * * head , const int n );
26+ void free_listint (listint_t * head );
27+ void free_listint2 (listint_t * * head );
28+ int pop_listint (listint_t * * head );
29+ listint_t * get_nodeint_at_index (listint_t * head , unsigned int index );
30+ int sum_listint (listint_t * head );
31+ listint_t * insert_nodeint_at_index (listint_t * * head , unsigned int idx , int n );
32+ int delete_nodeint_at_index (listint_t * * head , unsigned int index );
33+ listint_t * reverse_listint (listint_t * * head );
34+ size_t print_listint_safe (const listint_t * head );
35+ size_t free_listint_safe (listint_t * * h );
36+ listint_t * find_listint_loop (listint_t * head );
37+
38+
39+ #endif
You can’t perform that action at this time.
0 commit comments