|
10. |
|
Assume List is a linked list of integers.
List mystery( int a, int b, List L )
{
if( L is empty ) return L;
if(a == first(L)) return prepend( b, mystery(a, b, tail(L)) );
return prepend( first(L), mystery( a, b, tail(L) ) );
}
The call mystery(a, b, L)returns a linked list just like L
except that |
|