Lab 11 Comp 170-201 -- Dordal/Nabicht -- Wed, November 20, 2002 Final version due by final exam In this lab we will write some recursive functions involving the StringList class. While the primary goal is to familiarize yourself with recursion, this lab also further illustrates the idea of "dynamic data structures": data structures (in our case lists) that depend on objects containing references to other objects. You are to implement recursive versions of the following in the StringList class. Each function must, as all recursive functions must, have: * an "atomic" case in which no recursion occurs * a recursive case in which we invoke a *simpler* case. For all these list examples, note that any reference to Cell can be the start of a list. Given a Cell (reference) c, then c.data() is the first *data* on the list, and c.next(), another Cell, is in fact the rest of the list, ie, a list that is shorter by one. int length(): returns the length of the stringlist atomic case: _start == null simpler case: list shorter by one. THe shorter list is _start.next(). void append(Stringlist s): appends the current list onto the front of list s. atomic case: _start==null, in which case there is no change to s._start. Simpler case: The shorter list is, as usual, _start.next(). Append that, and then stick _start.data() on the front. In other words, proceed much as in copy(). boolean search(String s): returns true or false according to whether the string s is present in the current StringList. Here there are *two* atomic cases: 1. _start == null, in which case return false 2. _start.data().equals(s), in which case return true (s is found at the very front) Simpler case: search the shorter-by-one list _start.next().