quiz2soln - Quiz 2 Solution CpE 360 – Computational...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Quiz 2 Solution CpE 360 – Computational Algorithms and Data Structures Instructor: Ashish Patel October 26, 2006 (Close notes, close books. Circle on your answers) 1. Assume that numbers 9, 3, 118, 24, 11 are pushed on a stack, three numbers are popped, then numbers 6, 34 are pushed on the stack, and one number is popped. What remains on the stack? Answer: 9, 3, 6 2. Assume that numbers 11, 3, 55, 24, 9, 29 are pushed on a stack, two numbers are popped, then numbers 6, 34 are pushed on the stack, and three numbers are popped. What remains on the stack? Answer: 11, 3, 55 3. If numbers 3, 22, 4, 51, 37 are inserted in a queue, which one will be removed first? Answer: 3 4. If numbers 10, 22, 33, 48, 11 are inserted in a queue, two numbers are removed, then numbers 18, 67 are inserted in the queue, and three numbers are removed. What remains in the queue? Answer: 18, 67 5. If numbers 10, 22, 35, 47, 15, 11 are inserted in a queue, three numbers are removed, then numbers 19, 44, 32 are inserted in the queue, and two numbers are removed.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/25/2010 for the course CPE CPE 360 taught by Professor Jenniferchen during the Spring '10 term at Stevens.

Page1 / 2

quiz2soln - Quiz 2 Solution CpE 360 – Computational...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online