MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Choose correct output for the following sequence of operations.push(5)push(8)poppush(2)push(5)poppoppoppush(1)pop
A
85251
B
85521
C
82551
D
81255
Explanation: 

Detailed explanation-1: -The number that will be generated on push(5), push(8), pop, push(2), push(5), pop, push( ) will be 52 not 8552. incorrect option: (c) 255!

Detailed explanation-2: -Detailed Solution. The correct answer is 2, 2, 1, 1, 2.

Detailed explanation-3: -Answer: The sequence of popped out values is : 2, 2, 1, 1, 2.

There is 1 question to complete.