CSC 216 Lecture Notes - Lecture 13: Dynamic Array, Array Data Structure, Upper And Lower Bounds

38 views7 pages
4 Oct 2016
School
Course
Professor

Document Summary

Collections: data structures store elements in a manner that makes it easy for a client to work with elements: specific kinds of collections are specialized for particular kinds of operations, such as . Add/remove: common sets of operations for collections: add, remove, get, contains, size. List: an ordered collection of elements, accessible by a zero-based index: has a size equal to the number of elements in the list, elements can be added to an empty list, at the front, middle, and back. Scenario: suppose a course has a list of enrolled students. We want to be able to enroll, drop, email all the students, etc etc but classes like arrayintlist won"t work with this: options: Create an arraycourselist but then we"ll have to create a custom list for every object type. Create an arraylist of objects but then we"ll have to cast when we get objects out. Working with arraylist: constructing: arraylist list = new.

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