In this video I’ll implement/write program/code for the Stack topic of C++ Data Structure’s using array Step By Step with comments.
Stacks are basically type of container adaptors with FOLI(First Out Last In) type of working,
where a new element is added at one end and (top) an element is removed
from that end only.It is also called LIFO(Last In First Out).
The functions that I created for the stack using array are:
bool isEmpty() – Returns whether the stack is empty – Time Complexity : O(1)
size – Returns the size of the stack – Time Complexity : O(1)
top – It tell us about the top most element of the stack – Time Complexity : O(1)
push(int val) – Adds the elements “val” at the top of the stack – Time Complexity : O(1)
pop() – Remove the top most element from the stack – Time Complexity : O(1)
For More Videos Please Subscribe to My Channel.
Feel free to comment down…
c++ coding program