COMPSCI 61B Lecture 4: SLLists, Nested Classes, Sentinel Nodes

63 views4 pages
31 Jan 2019
School
Professor

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.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents