forked from ASD-ADF/ASD_Task_4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist.h
67 lines (46 loc) · 1.18 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef LIST_H_INCLUDED
#define LIST_H_INCLUDED
#include <string>
#include <windows.h>
#include <iostream>
#define first(L) L.first
#define next(P) P->next
#define prev(P) P->prev
#define info(P) P->info
using namespace std;
struct music {
int ID;
string name;
string location;
};
typedef music infotype;
typedef struct elmlist *address;
/**
* IMPLEMENT CIRCULAR DOUBLE LINKED LIST
* USE ONLY ONE HEAD (FIRST)
*/
struct elmlist {
//------------- YOUR CODE HERE -----------
infotype info;
address prev;
address next;
//----------------------------------------
};
struct List {
//------------- YOUR CODE HERE -----------
address first;
//----------------------------------------
};
/** YOU DON'T NEED TO MODIFY THIS */
void createList(List &);
address allocate(infotype );
void deallocate(address &);
void insertFirst(List &, address );
void insertLast(List &, address );
void insertAfter(List &, address &, address);
void deleteFirst(List &, address &);
void deleteLast(List &, address &);
void deleteAfter(List &, address &, address &);
address findElmByID(List, infotype );
address findElmByName(List, infotype );
#endif // LIST_H_INCLUDED