diff --git a/Data Structures/Stacks/get_minimum_element_of_stack_without_extra_space.cpp b/Data Structures/Stacks/get_minimum_element_of_stack_without_extra_space.cpp new file mode 100644 index 000000000..79dd99e08 --- /dev/null +++ b/Data Structures/Stacks/get_minimum_element_of_stack_without_extra_space.cpp @@ -0,0 +1,95 @@ +#include + +using namespace std; + +int stack[50], minimum, top=-1,x; + +void push(int x) +{ + if (top==-1) + { + top++; + stack[top]=x; + minimum = x; + } + else + { + if (x>n; + + cout<<"1) Push"<>choice; + switch(choice) { + case 1: { + cout<<"Enter the value to be entered in the stack: "<>x; + push(x); + break; + } + case 2: { + pop(); + break; + } + case 3: { + int minimum=getmin(); + break; + } + case 4: { + cout<<"Exit"<