-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
43 lines (36 loc) · 1.08 KB
/
main.cpp
File metadata and controls
43 lines (36 loc) · 1.08 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
#include "DoubleLinkedList.h"
#include "Exceptions.h"
#include <iostream>
using namespace std;
int main() {
DoubleLinkedList firstList;
firstList.insert(5);
firstList.insert(2);
firstList.insert(1);
firstList.insert(3);
firstList.insert(6);
firstList.insert(7);
firstList.insert(3);
cout << "First List:" << endl;
firstList.display();
firstList.display(true);
cout << "Removing 3, 1, 10, and 7" << endl;
firstList.remove(3);
firstList.remove(1);
firstList.remove(10);
firstList.remove(7);
firstList.display();
cout << "First List Count: " << firstList.getCount() << endl;
DoubleLinkedList secondList;
cout << "First number in the list: " << firstList[1] << endl;
DoubleLinkedList three;
secondList.insert(10);
secondList.insert(8);
secondList.insert(20);
cout << endl << "Second List:" << endl;
secondList.display();
cout << endl << "Merging" << endl;
firstList.merge(&secondList);
secondList.display();
firstList.display();
}