Name: ________________________________
Honor Code Acknowledgment: ___________________
Describe what the function Chop, shown below, does
the parameter list (assume list is a "standard"
struct for implementing linked lists of integers).
Problem 1 Spivey's Corners: (2 points)
void Chop(Node * & list)
{
if (list != NULL)
{
Chop(list->next);
if (list->info % 2 == 0)
{
list = list->next;
}
}
}
Problem 2 Babes In Toyland: (2 points)
Show how to change the code in Chop above so that nodes that
are unlinked from the list are returned to the heap using
delete.