Consider a sequence a of elements a0=1,a1=5,a2=7,a3=8,a4=9, and a5=2. The following operations are performed on a stack S and a queue Q, both of which are initially empty.
1. push the elements of a from a0 to a5 in that order into S.
2. enqueue the elements of a from a0 to a5 in that order into S.
3. pop an element from S.
4. dequeue an element from Q.
5. pop an element from S.
6. dequeue an element from Q.
7. dequeue an element from Q and push the same element into S.
8. Repeat operation VII three times.
9. pop an element from S.
10. pop an element from S.
The top element of S after executing the above operations is ______________.
WebSite: www.EasyExamNotes.com
Our FB page: / easyexamnotesdotcom
Lectures Library:
1) Analysis & Design of Algorithm: • Video
2) Data Structure Lectures: • Video
3) Computer Organization Architecture: • Computer Organization Architecture
4) Operating System Lectures: • Fragmentation (Hindi) | OS | Jayesh Umre
5) Theory Of Computation Lectures: • Lec-4 Draw a DFA accepting strings s...
6) DBMS Lectures: • RDBMS (Hindi) | Jayesh Umre
7) Principles Of Programming Languages: • Language Evaluation Criteria | PPL | ...
8) Internet Of Things: • IOT Conceptual Framework in Hindi | J...
9) Discrete Structures: • Prove set G= {1, 2, 3, 4, 5, 6} is ab...
10) Cloud Computing Lectures: • RAID-Redundant Array of Independent D...
11) Software Engineering: • RAD model | SDLC | Jayesh Umre
12) Digital Circuits: • Half Adder | Jayesh Umre
13) Number System: • 10's Complement | Jayesh Umre
14) GATE Mathematics: • GATE | Adjoint of a Matrix | Jayesh Umre
15) Management Information System: • MIS in Hindi
16) Computer Network: • Computer Networks in Hindi
====================================================