Answer to Question linkedlist1-1
Copying an empty list yields an empty list.
Copying a nonempty list involves just
doing a cons with the list's head and
a copy of its tail.
static List copyList(List L)
{
if(isEmpty(L))
{
return emptyList;
}
else
{
return cons(head(L), copyList(tail(L)));
}
}