-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDLL.h
More file actions
53 lines (44 loc) · 1.02 KB
/
DLL.h
File metadata and controls
53 lines (44 loc) · 1.02 KB
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
/*
Cosimo Gonnelli
This is the headed for the actual quiz that will be crested getting
questions from the BST. The questions will be selected randomly
according to the category name and a random number.
*/
#include"question.h"
//DLL node that has a pointer to a question
class d_node
{
public:
d_node();
~d_node();
d_node(const question & toCopy);
d_node(const mChoice & toCopy);
d_node(const trueFalse & toCopy);
d_node *& goNext();
d_node *& goPrevious();
void setNext(d_node *& connect);
void setPrevious(d_node *& connect);
question *& getQuestion();
void display() const;
protected:
d_node * next;
d_node * previous;
question * myQuestion;
};
//Quiz class
class DLL
{
public:
DLL();
~DLL();
int destroy();
int insert(question *& toAdd);
bool removeMatch(int match);
int displayQuiz() const;
protected:
int destroy(d_node *& head);
int displayQuiz(d_node * head) const;
bool removeMatch(d_node *& head, d_node *& tail, int match);
d_node * head;
d_node * tail;
};