|
CS211 Fall 2003 Prelim 1
Problem 1:
1. Part (b) had most number of errors
2. Confused upcasting and downcasting
Problem 2:
1. For part (b), most had only 1 base case
2. Incorrect flow of proof
3. For part (b), induction hypothesis not strong enough
Problem 3:
1. No typecasting for the return value of Math.pow into int
2. In (b), no comment on what A(2,2) returns
3. Computational error in (b)
Problem 4:
1. Most solutions break if f == null
2. Looks at or uses data part of ListCell (not necessary at all)
3. Incorrect sequence of setNext() calls. Loses reference to all or part
of list
4. Recursive solution does not return pointer to the new head of list
Problem 5:
1. Ignored the root == null base case
2. No typecasting for the returned Object into Integer when getDatum()
is called
Problem 6:
1. Most had only one correct traversal (pre or post)
2. Confused definitions of pre and postorder traversal
3. Wrong answer in (b)
|