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.
Describe the term two-dimensional array by using example?
Is it possible to insert the various types of elements in a stack? Explain how?
What is meant by the debugging?
Define when we should use plain list.
What does isEmpty() member technique determines?
What is the quickest sorting method to use?
Explain an algorithm. Illustrates the properties of an algorithm?
Explain binary tree in brief.
Write some of the disadvantages of the sequential storage?
What is the way to implement of traversal of a binary tree?
18,76,764
1928357 Asked
3,689
Active Tutors
1453728
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!