From b46c49228497cb440467167bad3123c327bd620f Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 17 Oct 2017 00:12:32 +0800 Subject: add --- data_structures/chapter_3/linked_list.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 data_structures/chapter_3/linked_list.h (limited to 'data_structures/chapter_3/linked_list.h') diff --git a/data_structures/chapter_3/linked_list.h b/data_structures/chapter_3/linked_list.h new file mode 100644 index 0000000..ecd9040 --- /dev/null +++ b/data_structures/chapter_3/linked_list.h @@ -0,0 +1,23 @@ +#ifndef _LIST_H + +struct node; +typedef struct node *node_ptr; +typedef node_ptr list; +typedef node_ptr position; + +/* elem to int */ +typedef int elem; + +list make_empty(list header); +int is_empty(list header); +int is_last(position p, list header); +position find(elem x, list header); +void delete(elem x, list header); +position find_previous(elem x, list header); +void insert(elem x, list header, position p); +void delete_list(list header); +position header(list header); +position first(list header); +position advance(position p); + +#endif /* _LIST_H */ -- cgit v1.2.3