Implement queue by using stack
Define how to implement queue by using stack?
Expert
A queue can be implemented with two stacks as follows:
a. An element is inserted within the queue through pushing this within stack 1
b. An element is extracted by the queue through popping this from the stack 2
c. When the stack 2 is empty then each element currently within stack 1 are transferred to stack 2 but within the reverse order
d. When the stack 2 is not empty only pop the value by stack 2.
Define when we should use plain list.
What is meant by the debugging?
Briefly describe the term sequential search? And also write down the average number of comparisons in a sequential search?
What do you mean by Huffman algorithm?
A Linked List Instead Of an Array When Should You Use?
Write down a brief note on the term iterative algorithm?
Illustrate the term algorithm. Write down some of the properties of an algorithm?
Explain when AVL tree property is violated and describe how to solve it?
What are the applications where stacks are used?
By using a declaration statement how is memory reserved?
18,76,764
1945733 Asked
3,689
Active Tutors
1438513
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!