-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinkedList.h
50 lines (34 loc) · 987 Bytes
/
LinkedList.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
#ifndef ASSIGN2_LINKEDLIST_H
#define ASSIGN2_LINKEDLIST_H
#include "Node.h"
#include <string>
#include <memory>
typedef SharedTile SharedTile;
class LinkedList {
public:
//Constructor
LinkedList();
//Destructor
~LinkedList();
// Return length of LinkedList
int size();
// return Tile at index i
SharedTile getTile(int i);
SharedTile getTile(const Tile& searchTile);
// Add tile
void addTile(const SharedTile& tile);
//Check if LinkedList is empty or not.
bool isEmpty();
// delete tile at index i
SharedTile deleteTile(const SharedTile& toRemove);
// To String method
string toString(bool isColour, bool isSaving);
private:
// Point at the head of Linked List
std::shared_ptr<Node> head;
//Point at the tail of the Linked List
std::shared_ptr<Node> tail;
//Length of the Linked List
int length;
};
#endif // ASSIGN2_LINKEDLIST_H