-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslist.h
47 lines (38 loc) · 987 Bytes
/
slist.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
/*
Header file for single linked list class library
*/
// Constructor
class Node {
public:
Node *next;
void *data;
Node();
Node(void *data);
};
class linkedList {
Node *head;
public:
linkedList();
void add(void *data);
void insert(int index, void *data);
void remove(int index);
void *get(int index);
Node *getNode(int index);
int size();
bool equals(linkedList slist2);
void clear();
void exchg(int index1, int index2);
void swap(Node *index1, Node *index2);
bool isEmpty();
void set(int index, void *data);
~linkedList();
};
// Destructor
// DO NOT IMPLEMENT >>> subList(start, length) //Returns a new list containing
// elements from a sub-range of this list.
// DO NOT IMPLEMENT >>> toString() //Converts the
// list to a printable string representation.
// subList(start, length) //Returns a new list containing elements from a
// sub-range of this list.
// toString() //Converts the list to a printable
// string representation.