-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (26 loc) · 655 Bytes
/
Copy pathmain.cpp
File metadata and controls
34 lines (26 loc) · 655 Bytes
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
#include <iostream>
#include "SinglyLinkedList.h"
int main()
{
SinglyLinkedList<int>* list = new SinglyLinkedList<int>();
node<int>* node1 = new node<int>();
node1 -> setData(3);
node<int>* node2 = new node<int>();
node2 -> setData(4);
node<int>* node3 = new node<int>();
node3 -> setData(5);
node<int>* node4 = new node<int>();
node4 -> setData(6);
node<int>* node5 = new node<int>();
node5 -> setData(7);
list -> add(node1);
list -> add(node2);
list -> add(node3);
list -> add(node4);
list -> add(node5);
list -> display();
list -> remove(node3);
list -> display();
list -> clear();
list -> display();
}