Implementation of queue using stack
Describe the process how to implement the queue by using stack.
Expert
The queue can be implemented by using two stacks as:
a) The element is inserted in the queue by pushing it into the stack 1.
b) Element is extracted from the queue by popping it from the stack 2.
c) If the stack 2 is empty then all the elements presently in stack 1 are transferred to stack 2 however in the reverse order.
d) If the stack 2 is not empty simply pop the value from the stack 2.
Explain different types of the coupling?
Explain different types of cohension?
Describes the bubble sort algorithm?
Define how to implement queue by using stack?
Explain the Merge Sorting.
Define the isEmpty() member method.
Explain the queue operation in brief.
Define the use of Direct Access in linked list instead of an array or vice versa.
What are the differences between Recursive Case and Tail Recursion?
Illustrate the difference between the stack and Queue in brief?
18,76,764
1951473 Asked
3,689
Active Tutors
1422450
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!