E81 CSE 131 Lecture 8: List
magentarat813 and 20 others unlocked
8
E81 CSE 131 Full Course Notes
Verified Note
8 documents
Document Summary
2:43 pm: an ordered collection of elements, duplication of elements is allowed. I. e. eat, study, eat, exercise, eat, sleep. Order is important: list is a parametric type. Parameterized by the kinds of things in the list. A list contains elements only of type t. T can be a more general type. Many shaped: object is the most general type of all. List can contain any type of object: syntax: Find the nth thing in the list. Find out where something occurs in the list. Find out the length of the list: no matter how the list is implemented, we should be able to perform these operations to any list operations to any list. Specific implementations may differ in how they carry out the above operations: public interface list < t > , // uses interface instead of class, // has the parametric type in the class name, // no constructors.