COMPSCI 61B Lecture 4: SLLists, Nested Classes, Sentinel Nodes
Document Summary
While functional, naked linked lists are hard to use. Users of this class are probably going to need to know references very well to be able to think recursively. Intnode has no methods but the functionality will be added in later. Sllist is easier to instantiate (no need to specify null) and we will see more advantages to come. Sllist is much simpler to use - use the provided methods. The sllist class acts as a middle man between the user and raw data structure (intlist user has variables that point to the middle of the intlist) Our sllist can be bypassed and the raw power of our naked data structure can be accessed as a programmer can easily modify the list directly, without going through the method. We can prevent programmers from making such mistakes by using the private keyword which prevents code in other classes from using members (or constructors) of a class.