-
Notifications
You must be signed in to change notification settings - Fork 0
/
slist2R.h
42 lines (32 loc) · 1.17 KB
/
slist2R.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
#ifndef _INCLUDED_SLIST
#define _INCLUDED_SLIST
#include<stdint.h>
typedef struct _node_ Node;
typedef struct _slist_ Slist;
struct _node_{
int32_t data; // node def(data and next node address)
Node *next;
};
struct _slist_{
Node *head;
Node *tail; //head and tail data
uint32_t length;
};
/* public interface for user*/
Slist slist_new();
uint32_t slist_length(Slist *list);
uint32_t slist_lookup(Slist *list,int32_t key);
Slist* slist_add_head(Slist *list,int32_t element);
Slist* slist_add_tail(Slist *list,int32_t element);
//Slist* slist_delete_head(Slist *list);
//Slist* slist_delete_tail(Slist *list);
Slist* slist_display(Slist *list);
//Slist* slist_min_max(Slist *list);
//Slist* slist_spec_ele(Slist *list, int32_t element,int32_t spec_ele);
//Slist* slist_spec_ele_delete(Slist *list, int32_t spec_ele);
//uint32_t list_compare(Slist *list1,Slist *list2);
Slist* reverse_list(Slist *list);
//Slist* union_twolist(Slist *union_list,Slist *list1,Slist *list2);
Slist* intersection_twolist(Slist *intersection_list,Slist *list1,Slist *list2);
//Slist* unique_slist(Slist* list,uint32_t element);
#endif // SLIST_H_INCLUDED