Can you please explain stack operation?
Submitted by: AdministratorStack is a data structure that follows Last in First out strategy.
Stack Operations:-
Push – Pushes (inserts) the element in the stack. The location is specified by the pointer.
Pop – Pulls (removes) the element out of the stack. The location is specified by the pointer
Swap: - the two top most elements of the stack can be swapped
Peek: - Returns the top element on the stack but does not remove it from the stack
Rotate:- the topmost (n) items can be moved on the stack in a rotating fashion
A stack has a fixed location in the memory. When a data element is pushed in the stack, the pointer points to the current element.
Submitted by: Administrator
Stack Operations:-
Push – Pushes (inserts) the element in the stack. The location is specified by the pointer.
Pop – Pulls (removes) the element out of the stack. The location is specified by the pointer
Swap: - the two top most elements of the stack can be swapped
Peek: - Returns the top element on the stack but does not remove it from the stack
Rotate:- the topmost (n) items can be moved on the stack in a rotating fashion
A stack has a fixed location in the memory. When a data element is pushed in the stack, the pointer points to the current element.
Submitted by: Administrator
Read Online Stack And Queue Job Interview Questions And Answers
Top Stack And Queue Questions
☺ | Explain stacks and queues in detail? |
☺ | Tell me how to implement queue using stack? |
☺ | Can you explain queue operation? |
☺ | Do you know what is a circular singly linked list? |
☺ | Tell me what are priority queues? |
Top Coding/Programming Categories
☺ | Python Interview Questions. |
☺ | OOP Interview Questions. |
☺ | Software engineering Interview Questions. |
☺ | PHP Interview Questions. |
☺ | VBA (Visual Basic for Applications) Interview Questions. |