Login
Remember
Register
Ask a Question
What are differences between stack and queue data structure?
0
votes
asked
Aug 9, 2023
in
DBMS
by
DavidAnderson
What are differences between stack and queue data structure?
data-structure-interview-questions
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Aug 9, 2023
by
DavidAnderson
Stack
Queue
Stack is a linear data structure where data is added and removed from the top.
Queue is a linear data structure where data is ended at the rear end and removed from the front.
Stack is based on LIFO(Last In First Out) principle
Queue is based on FIFO(First In First Out) principle
Insertion operation in Stack is known as push.
Insertion operation in Queue is known as eneque.
Delete operation in Stack is known as pop.
Delete operation in Queue is known as dequeue.
Only one pointer is available for both addition and deletion: top()
Two pointers are available for addition and deletion: front() and rear()
Used in solving recursion problems
Used in solving sequential processing problems
...