This preview shows pages 1–3. Sign up to view the full content.
COP 3503 – Final Exam Practice Problems
These problems are similar in nature to those that you will see on the final exam.
The final exam
in comprehensive and not every topic that we have covered is represented here so don’t study for
the final based upon this homework only!
1.
For the binary tree shown below, show the output of a preorder traversal of the tree.
For additional
practice do: inorder, postorder, and level order traversals.
2.
Define and explain the following terms:
(1) a greedy algorithm
(2) divide and conquer algorithm
3.
Show the contents of a stack after each of the following operations.
What is the final value of the
stack?
(1) push (20)
(2) push (15)
(3) push (pop( )  pop( ))
(4) push (10)
(5) push( pop( ) + pop( ))
(6) top( )
1
A
B
E
C
F
G
D
H
I
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document4.
Shown below is an expression tree that represents a valid infix expression.
Convert the expression
to a prefix expression.
What technique did you use to do this conversion?
5.
Write a pseudocode algorithm that will delete an arbitrary node identified by the pointer
del
from a
doubly linked list.
6.
Shown below is a conjecture.
Complete an induction proof that proves the conjecture is true for all
integer numbers greater than or equal to 1.
Conjecture:
This is the end of the preview. Sign up
to
access the rest of the document.
 Spring '08
 Staff
 Computer Science

Click to edit the document details