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.
Is it possible to insert the various types of elements in a stack? Explain how?
Write down a brief note on the term iterative algorithm?
Illustrate the difference between the stack and Queue in brief?
Describe any two merits using single linked list over the doubly linked list and vice-versa?
Define in detail the term Disjoint set.
Explain about the merge sort algorithm.
Define testing?
Explain about a B+ tree and its uses.
Write down the various types of algorithms?
Briefly describe the term Tree database. Elucidate its common uses?
18,76,764
1946594 Asked
3,689
Active Tutors
1442310
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!