
CS 405/505 ASSIGNMENT #1
Due Thursday, August 23, 2007, 9:45 P. M.
Fill in the Blank.
1. Name:
2. I have satisfied the prerequisites of CS 303 Algorithms and Data Structures and CS 350
Formal Languages and Automata, or equivalent, each with a grade of C or better.
Signature:
True or False.
For each of the problems below, indicate whether it is true or false. Justify your answer in either
case.
3. A context-free grammar defining a deterministic context-free language may always be con-
verted into a deterministic pushdown automaton.
4. The context-free grammar below is ambiguous.
Sโif (e) S|if (e) Selse S|s
5. It is not possible to implement a tree data structure where interior nodes have an arbitrary
number of children (e.g. some nodes may have 1 child, some 2, some 3, etc.).
Short Answer.
6. Assume a binary tree object with functions value,left and right to return the value of
the current node, left subtree, and right subtree, respectively. Using an actual programming
language or pseudo-code, write a function postorder to print the values of all nodes in the
tree using a post-order traversal. Please write your answer on back.