// Oldham, Jeffrey D. // 2000 Jan 18 // CS1321 // Example of Using the Linked List Class Code #include #include // has EXIT_SUCCESS #include "seq.h" // has linked list declarations using namespace std; // Add all the values in a list. int adder(Seq L) { if (L.empty()) return 0; else if (!L.empty()) return L.hd() + adder(L.tl()); } int main() { Seq L = Seq(4, Seq(3, Seq())); if (!L.empty()) cout << "The list is not empty.\n"; cout << "The total of the list is " << adder(L) << ".\n"; cout << "Bye!\n"; return EXIT_SUCCESS; }