Basic Operations on Stack
In order to make manipulations in a stack, certain operations are provided to us.
- push() to insert an element into the stack
- pop() to remove an element from the stack
- top() Returns the top element of the stack.
- isEmpty() returns true if the stack is empty else false.
- size() returns the size of the stack.
Time Complexity of Stack Operations:
Operations | Complexity |
---|---|
push() | O(1) |
pop() | O(1) |
isEmpty() | O(1) |
size() | O(1) |
Stack Notes for GATE Exam [2024]
Stacks, a fundamental data structure in computer science, are crucial for understanding algorithmic paradigms and solving complex computational problems. As candidates gear up for the GATE Exam 2024, a solid grasp of stack concepts is indispensable. These notes are designed to provide a concise yet comprehensive overview of stacks, covering key topics that are likely to be assessed in the GATE examination.
Table of Content
- Introduction to Stack:
- LIFO (Last In First Out) in Stack:
- Basic Operations on Stack
- Implementation of Stack using Singly Linked List:
- Applications, Advantages and Disadvantages of Stack:
- Infix to Postfix Operation in Stack:
- Postfix Evaluation using Stack:
- Towers of Hanoi using Stack:
- Fibonaaci Series using Stack:
- Previously Asked GATE Questions on Stack:
Contact Us