probset6_sol

# probset6_sol - Department of Electrical and Computer...

This preview shows pages 1–3. Sign up to view the full content.

Department of Electrical and Computer Engineering The University of Texas at Austin EE 306, Fall 2009 Problem Set 6 Solutions Due: Not to be turned in Yale N. Patt, Instructor TAs: Aater Suleman, Chang Joo Lee, Ameya Chaudhari, Antonius Keddis, Arvind Chandrababu, Bhargavi Narayanasetty, Eshar Ben-dor, Faruk Guvenilir, Marc Kellermann, RJ Harden Note: This problem set is unusually long, and is not to be turned in. We have put it together and handed it out to give you some challenging examples to help you prepare for the final exam. (Adapted from 10.9) The input stream of a stack is a list of all the elements we pushed onto the stack, in the order that we pushed them. The input stream from Excercise 10.8 from page 284 of the book for example is ABCDEFGHIJKLM The output stream is a list of all the elements that are popped off the stack in the order that they are popped off. a. If the input stream is ZYXWVUTSR, create a sequence of pushes and pops such that the output stream is YXVUWZSRT. Push Z Push Y Pop Y Push X Pop X Push W Push V Pop V Push U Pop U Pop W Pop Z Push T Push S Pop S Push R Pop R Pop T b. If the input stream is ZYXW, how many different output streams can be created. 14 different output streams. Do Problem 6.16 on page 175 in the textbook.

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

View Full Document