Name: ________________________________
Honor Code Acknowledgment: ___________________
Random Quiz # 3
CPS 100, Fall 1995
Due: September 26
Problem 1: In a fix (2 points)
What is the value of the following postfix expression?
8 5 + 3 2 * - 7 *
Problem 2: Spivey's Corner (2 points)
Describe what the procedure Chop shown below does to its list
parameter.
void Chop(ListNode * & list)
{
if (list != NULL)
{
Chop(list->next);
if (list->info % 2 == 0)
{
list = list->next;
}
}
}
Problem 3: Waste Management (2 points)
Storing single digits in each node of a linked list as is done in the
DigitSeq class (with linked lists)
is not making efficient use of space. Agree or
disgree with this statement and justify your choice with one sentence.