-
Notifications
You must be signed in to change notification settings - Fork 0
/
CircularDoublyLinkedList.h
57 lines (42 loc) · 1.17 KB
/
CircularDoublyLinkedList.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// copyright 2022 Ciocoiu Diana-iulia 313CA
#ifndef CIRCULARDOUBLYLINKEDLIST_H_
#define CIRCULARDOUBLYLINKEDLIST_H_
typedef struct dll_node_t dll_node_t;
struct dll_node_t
{
void* data;
dll_node_t *prev, *next;
};
typedef struct doubly_linked_list_t doubly_linked_list_t;
struct doubly_linked_list_t
{
dll_node_t* head;
unsigned int data_size;
unsigned int size;
};
/*
* Acestea sunt functiile pe care trebuie sa le implementam.
* Implementarea acestora se va face in LinkedList.c .
*/
doubly_linked_list_t*
dll_create(unsigned int data_size);
dll_node_t*
dll_get_nth_node(doubly_linked_list_t* list, unsigned int n);
void
dll_add_nth_node(doubly_linked_list_t* list, unsigned int n,
const void* new_data);
dll_node_t*
dll_remove_nth_node(doubly_linked_list_t* list, unsigned int n);
unsigned int
dll_get_size(doubly_linked_list_t* list);
void
dll_free(doubly_linked_list_t** pp_list);
void
dll_print_int_list(doubly_linked_list_t* list);
void
dll_print_string_list(doubly_linked_list_t* list);
void
dll_print_ints_right_circular(dll_node_t* start);
void
dll_print_strings_left_circular(dll_node_t* start);
#endif // CIRCULARDOUBLYLINKEDLIST_H_"