min-stack 1.0.0
Min Stack
Loading...
Searching...
No Matches
main.cpp File Reference
#include <bits/stdc++.h>
Include dependency graph for main.cpp:

Go to the source code of this file.

Data Structures

class  MinStack
 

Functions

int main ()
 Your MinStack object will be instantiated and called as such: MinStack* obj = new MinStack(); obj->push(val); obj->pop(); int param_3 = obj->top(); int param_4 = obj->getMin();.
 

Function Documentation

◆ main()

int main ( )

Your MinStack object will be instantiated and called as such: MinStack* obj = new MinStack(); obj->push(val); obj->pop(); int param_3 = obj->top(); int param_4 = obj->getMin();.

Definition at line 84 of file main.cpp.

85{
86 try
87 {
88 unique_ptr<MinStack> s(make_unique<MinStack>());
89 s->push(-2);
90 s->push(0);
91 s->push(-3);
92 cout << "min: " << s->getMin() << '\n';
93 s->pop();
94 cout << "top: " << s->top() << '\n';
95 cout << "min: " << s->getMin() << '\n';
96 }
97 catch(const std::exception& e)
98 {
99 cerr << e.what() << '\n';
100 }
101
102 return 0;
103}