-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStackTest.cpp
More file actions
28 lines (27 loc) · 787 Bytes
/
Copy pathStackTest.cpp
File metadata and controls
28 lines (27 loc) · 787 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
#include "StackTest.h"
void testStack(){
std::cout<<std::endl;
Stack<int> sta_1;
Stack<int> sta_2(1);
sta_2.printList();
sta_2.push_front(34);
sta_2.printList();
std::cout<<"last: "<<sta_2.lastData()<<std::endl;
sta_2.push_front(3);
sta_2.printList();
sta_2.push_front(52);
sta_2.printList();
std::cout<<"last: "<<sta_2.lastData()<<std::endl;
LinkedList<int> lList = sta_2.sort();
lList.printList();
std::cout<<"empty: "<<sta_2.empty()<<std::endl;
std::cout<<sta_2.at(3)<<std::endl;
std::cout<<"pop front: "<<sta_2.pop_front()<<std::endl;
sta_2.printList();
std::cout<<"pop front: "<<sta_2.pop_front()<<std::endl;
sta_2.printList();
std::cout<<"clear\n";
sta_2.clear();
sta_2.printList();
std::cout<<"empty: "<<sta_2.empty()<<std::endl;
}