# F01MT2 - CET 230 Applied Data Structures Fall 2001 MidTerm...

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

CET 230 Applied Data Structures Fall 2001 MidTerm Exam 2 Name: 1. (10 points) Consider the usual algorithm to convert a fully parenthesized 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 but change the algorithm to the general case (not fully parenthesized): 2. (4 points) Entries in a stack are "ordered". What is the meaning of this statement? A. There is a first entry, a second entry, and so on. B. A collection of Stacks can be sorted. C. Stack entries may be compared with the compareTo method. D. The entries must be stored in a linked list. Page 1/6

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

View Full Document
CET 230 Applied Data Structures Fall 2001 MidTerm Exam 2 Name: 3. (4 points) Which of the following stack operations could result in stack underflow? A peek B. pop C. push D. Two or more of the above answers. 4. (4 points) Suppose we have an array implementation of the stack class, with twelve items in the stack stored at data[0] through data[11] . The CAPACITY is 42. Where does the push method place the new entry in the array? A. data[0] B. data[1] C. data[11] D. data[12] 5. (4 points) What is the postfix expression for the following infix: (a + b*(c - a) - d) A. d b c a - * a + -
This is the end of the preview. Sign up to access the rest of the document.

## F01MT2 - CET 230 Applied Data Structures Fall 2001 MidTerm...

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

View Full Document
Ask a homework question - tutors are online