F00MT2 - CET 230 Applied Data Structures Fall 2000 MidTerm...

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

View Full Document Right Arrow Icon
CET 230 Applied Data Structures Fall 2000 MidTerm Exam 2 Name: 1. (10 points) Consider the usual algorithm to convert an infix expression to a postfix expression. Suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: | | | + | | ( | bottom |___*___| Now, suppose that you read and process the 11th symbol of the input. Draw the stack for the case where the 11th symbol is: A. A number: B. A left parenthesis: C. A right parenthesis: D. A minus sign: E. A division sign: 2. (4 points) Entries in a stack are "ordered". What is the meaning of this statement? A. A collection of Stacks can be sorted. B. Stack entries may be compared with the '<' operation. C. The entries must be stored in a linked list. D. There is a first entry, a second entry, and so on. Page 1/6
Background image of page 1

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

View Full DocumentRight Arrow Icon
CET 230 Applied Data Structures Fall 2000 MidTerm Exam 2 Name: 3. (4 points) Which of the following stack operations could result in stack underflow? A is_empty B. pop C. push D. Two or more of the above answers 4. (4 points) Consider the following pseudocode: declare a stack of characters while ( there are more characters in the word to read ) { read a character push the character on the stack } while ( the stack is not empty ) { pop a character off the stack write the character to the screen } What is written to the screen for the input "carpets"? A.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/02/2012 for the course COMPUTER 101 taught by Professor Dr.kahan during the Spring '11 term at Akademia Ekonomiczna w Krakowie.

Page1 / 6

F00MT2 - CET 230 Applied Data Structures Fall 2000 MidTerm...

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

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