Consider You Have A Stack Whose Elements In It Are As Followsbr #159
Consider you have a stack whose elements in it are as follows.<br /> 5 4 3 2 << top<br /> Where the top element is 2.<br /> You need to get the following stack<br /> 6 5 4 3 2 << top<br /> The operations that needed to be performed are (You can perform only push and pop):
This multiple choice question (MCQ) is related to the book/course gs gs121 Data Structures and Algorithms. It can also be found in gs gs121 Abstract Data Types - Queue using Stacks - Quiz No.1.
Consider you have a stack whose elements in it are as follows.
5 4 3 2 << top
Where the top element is 2.
You need to get the following stack
6 5 4 3 2 << top
The operations that needed to be performed are (You can perform only push and pop):
5 4 3 2 << top
Where the top element is 2.
You need to get the following stack
6 5 4 3 2 << top
The operations that needed to be performed are (You can perform only push and pop):
Push(pop()), push(6), push(pop())
Push(pop()), push(6)
Push(pop()), push(pop()), push(6)
Push(6)
Similar question(s) are as followings:
Online Quizzes of gs121 Data Structures and Algorithms
Binary Trees - Binary Search Tree - Quiz No.1
gs gs121 Data Structures and Algorithms
Online Quizzes
Binary Trees - Binary Search Tree - Quiz No.2
gs gs121 Data Structures and Algorithms
Online Quizzes
Binary Trees - Preorder Traversal - Quiz No.1
gs gs121 Data Structures and Algorithms
Online Quizzes