CS 2110 Chapter Notes - Chapter 4: Popping

68 views3 pages
14 Jun 2017
Course
Professor

Document Summary

Section 4 - collections and enums o. Imagine just a box with a bunch of objects of type e. no order. Has methods add(e); contains(object); isempty(); remove(object); size(); Has the exact same methods as collection, but has a different specification. This is also an interface, but has two generics. Methods put(k, v); get(object key); key is the first argument in put. So this creates a mapping of an obejct from one type to another. Doesn"t need to be the same types. In put, the first object is the key, the second a value. Keys must be different, values can be the same. Linkedlist (class) inherits from both deque and list Think about a line to a register. Objects can only be added in the back. Objects can only be removed from the front. You can only put a new tray on top. You can only take away a tray from the top.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions