CS 107 S01 Homework 3

Due Friday 4/20 at the beginning of class

No late assignments will be accepted

Problem 1 is pencil and paper. Problems 2 and 3 are to be implemented.

  1. (30 points) (Infix, postfix and prefix)

    a. Convert each of the following expressions from infix to postfix.

    a+b+c+d

    (a+b)*(c/(d-e))

    b. Convert each of the following expressions from infix to prefix.

    2*(3+4)

    (a+b)*(c/(d-e))

    c. Convert each of the following expressions from postfix to infix.

    ab*cd+-

    ab+cde--*

  2. (30 points) CHV page 297 #2 (Language recognition with stacks)

    Data for the hard copy will be available on Wednesday 18 April.

  3. (40 points) CHV page 297 #4 (Infix expression evaluatuion)

    Data for the hard copy will be available on Wednesday 18 April.