-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathLinkedList.h
69 lines (52 loc) · 1.27 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include <string>
#include "LinkedListInterface.h"
template<typename T>
class LinkedList: public LinkedListInterface<T> {
public:
LinkedList() {
// implement your constructor here
}
virtual ~LinkedList() {
// implement your destructor here
}
virtual void push_front(T item) {
// implement push_front here
}
virtual void push_back(T item) {
// implement push_back here
}
virtual void insert(T item, size_t position) {
// implement insert here
}
virtual void pop_front() {
// implement pop_front here
}
virtual void pop_back() {
// implement pop_back here
}
virtual void remove(size_t position) {
// implement remove here
}
virtual T front() const {
// implement front here
}
virtual T back() const {
// implement back here
}
virtual T at(size_t index) const {
// implement at here
}
virtual bool contains(const T& item) const {
// implement contains here
}
virtual size_t size() const {
// implement size here
}
virtual void clear() {
// implement clear here
}
virtual std::string toString() const {
// implement toString here
}
};