-
Notifications
You must be signed in to change notification settings - Fork 0
/
ZLL.h
60 lines (46 loc) · 1015 Bytes
/
ZLL.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
#ifndef ZLL_H
#define ZLL_H
#include <iostream>
#include <string>
#include <iomanip>
#include "zany.h"
using namespace std;
template<typename T> class Node{
public:
T data;
Node* next;
Node* prev;
//friend class ZLL;
Node();
Node(T input);
};
template<typename T> class ZLL {
public:
ZLL(); //Defalut Constructor
~ZLL();//Destructor
//Member functions
bool front(const T& item);
bool back(const T& item);
bool join(ZLL &other);
ZLL<T> &operator+=(const ZLL &other);
ZLL<T> &operator-=(const ZLL &other);
int removeZany();
int removeNonZany();
bool promoteZany();
bool empty();
bool start();
bool done();
T getNext();
//Extra functions to delete later probably
bool isEmpty();
bool removeNode(int nodeIndex);
void printList();
private:
//Pointers for head and tail and list size
Node<T>* head;
Node<T>* tail;
Node<T>* iterator;
int listSize;
};
#include "ZLL.cpp"
#endif