-
Notifications
You must be signed in to change notification settings - Fork 1
/
List.h
54 lines (40 loc) · 1.28 KB
/
List.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
//Shrey Valia
//svalia
//PA5 : List.h - header file for List ADT to make a doubly linked list
//
#include <stdio.h>
#include <stdlib.h>
#ifndef Lex_List_h
#define Lex_List_h
// Exported type --------------------------------------------------------------
typedef struct ListObj* List;
// Constructors-Destructors ---------------------------------------------------
// newList()
// Returns reference to new empty Queue object.
List newList(void);
// freeQueue()
// Frees all heap memory associated with Queue *pQ, and sets *pQ to NULL.
void freeList(List* pL);
// Access functions -----------------------------------------------------------
int length(List L);
int getIndex(List L);
int front(List L);
int back(List L);
int getElement(List L);
int equals(List A, List B);
// Manipulation procedures ----------------------------------------------------
void clear(List L);
void moveTo(List L, int i);
void movePrev(List L);
void moveNext(List L);
void prepend(List L, int data);
void append(List L, int data);
void insertBefore(List L, int data);
void insertAfter(List L, int data);
void deleteFront(List L);
void deleteBack(List L);
void delete(List L);
// Other operations -----------------------------------------------------------
void printList(FILE* out, List L);
List copyList(List L);
#endif