-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
60 lines (48 loc) · 1.53 KB
/
Copy pathmain.cpp
File metadata and controls
60 lines (48 loc) · 1.53 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
52
53
54
55
56
57
58
59
60
/* Main file made to test the interatction between the LinkedLists and Nodes
Author: Ethan Smith
CPSC 1070 - Spring 2024
Lab 06 Phase C
*/
#include "List.h"
int main() {
List list;
int data;
cout << "Empty? " << list.empty() << endl;
cout << "size: " << list.size() << endl;
for(int i = 0; i < 100; i++) {
list.insertStart(i);
}
cout << "printed list: ";
list.printList();
cout << "size: " << list.size() << endl;
list.removeStart(&data);
cout << "printed list: ";
list.printList();
cout << "size: " << list.size() << endl;
list.insertEnd(44);
cout << "printed list: ";
list.printList();
cout << "size: " << list.size() << endl;
list.insertAt(3221, 4);
cout << "printed list: ";
list.printList();
cout << "size: " << list.size() << endl;
list.removeEnd(&data);
cout << "printed list: ";
list.printList();
cout << "size: " << list.size() << endl;
list.removeAt(&data, 4);
cout << "printed list: ";
list.printList();
cout << "size: " << list.size() << endl;
list.swapThisAndNext(4);
cout << "printed list: ";
list.printList();
cout << "size: " << list.size() << endl;
cout << "first: " << list.getFirst(&data) << endl;
cout << "last: " << list.getLast(&data) << endl;
cout << "head: " << list.getHead()->getData() << endl;
cout << "Finding num pos: " << list.find(43) << endl;
cout << "Getting num: " << list.getAt(55) << endl;
cout << "Empty? " << list.empty() << endl;
}