Question: 01. Suppose that a stack contains the following values Topf7, 5, 2, 9 } Bottom What is the contents of the stack after the following

01. Suppose that a stack contains the following values Topf7, 5, 2, 9 } Bottom What is the contents of the stack after the following operation? A) Top {7, 5, 2, 9) Bottom B) Top 1, 7, 5, 2, 9) Bottom C) Top f5, 2, 9} Bottom Push(1) D) Top f7, 5, 2, 9,1} Bottom E) None of the answers provided 02. Suppose that a stack contains the following values Topf7, 5, 2, 9 } Bottom What is the contents of the stack after the following operation (x is int)? A) Top {7, 5, 2} Bottom B) Top 7, 5, 2, 9) Bottom C) Top { ) Bottom Pop(x) D) Top f5, 2,9} Bottom E) None of the answers provided 03. Suppose that a stack contains the following values Topf7, 5, 2, 9 } Bottom What is the contents of the stack after the following sequence of operations are executed left-to-right (x is int)? Push(1), Pop(x) A) Top {1, 7, 5, 2,9} Bottom B) Top 7, 5, 2, 9,1} Bottom C) Top f5, 2, 9,1 Bottom D) Top f1, 7, 5, 2) Bottom E) None of the answers provided 04. Suppose that a stack contains the following values Topf7, 5, 2, 9 } Bottom What is the contents of the stack after the following sequence of operations are executed left-to-right (x is int)? Pop(x), Push(1) A) Top f5, 2, 9,1) Bottom B) Top 1,7, 5,2) Bottom C) Top 1, 5, 2, 9} Bottom D) Top f1, 7, 5, 2,9} Bottom E) None of the answers provided 05. What is the complexity of the MakeEmpty() operation for the linked node Stack implementation? C) O(logN) E) None of the answers provided B) O(N D) O(N2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
