-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cc
64 lines (57 loc) · 1.24 KB
/
main.cc
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
61
62
63
64
#include <iostream>
//#include "List.h"
// #include "Double_List.h"
#include "stack.h"
int main() {
List l;
// l.addToFront(1);
// l.addToFront(2);
// l.addToFront(3);
// l.print();
///*std::cout << l.at(0);
//std::cout << l.at(1);
//std::cout << l.at(2);*/
//l.insert(5, 3);
//l.delete_node(4);
///*std::cout << l.at(0);
//std::cout << l.at(1);
//std::cout << l.at(2);
//std::cout << l.at(3);*/
////std::cout << l .at(0);
////std::cout << l;
///*for (List::Iterator it = l.begin(); it != l.end(); ++it) {
// std::cout << *it << std::endl;
//}*/
//for (auto n : l) {
// std::cout << n << std::endl;
//}
////l.reverse_r();
// std::cout << std::endl;
///*for (auto n : l) {
// std::cout << n << std::endl;
//}*/
// l.reverse_print();
// Doubly Linked List
// Double_List l2;
// l2.addToFront(1);
// l2.addToFront(2);
// l2.addToFront(3);
// l2.insert(5, 3);
// for (auto n : l2) {
// std::cout << n << std::endl;
// }
//l2.reverse_print();
Stack s;
s.push(2);
s.push(3);
s.push(4);
s.print_stack();
s.pop();
s.print_stack();
std::cout << "Top is: " << s.top() << std::endl;
s.pop();
s.print_stack();
std::cout << "Top is: " << s.top() << std::endl;
s.pop();
std::cout << "Top is: " << s.top() << std::endl;
}