MA-351 Homework 3
Due at 4:59pm in my mailbox in SAS 3151, Wednesday, November 1, 2017
All solutions must be submitted in hardcopy
either to me in class or placed in my mailbox.
Note my office hours on my schedule.
DMM §3.3, Problem 8, page 107. Note: in order to
have a unique DFS tree, assume that the order of
the neighboring vertices of each vertex is alphabetical
and that you start at vertex labeled a.
Consider the formula for approximating the n-th Catalan number, based on
's formula for approximating n!:
Using the binary operators + (plus), - (minus),
* (times), / (divides),
and ^ (exponentiation), all of which have exactly 2 operands, draw the expression
tree corresponding to this expression.
Please note that 1/2 is not a constant, and that π is pi.
Convert the expression tree into a minimally parenthesized linear infix
expression string, using precedence and left-to-right rules whenever possible.
Write the prefix and postfix expression string equivalent to the expression tree.
Please consider the context-free grammar from class (also
given in Problem 1c in the
Fall 2016 second exam). Please give the parse tree
for the string a+b-c*d/e↑f↑g
Problem 4 in the
Fall 2006 second exam.