CSC 216 Lecture Notes - Lecture 4: Iterator, Binary Search Algorithm, Binary Search Tree

41 views8 pages
1 Sep 2016
School
Course
Professor

Document Summary

Class 4: java collections || building java programs, chapter 10. Examples found in the java class libraries: arraylist, linkedlist, hashmap, treeset, priorityqueue. All collections are in the java. util package: import java. util. List: a collection storing an ordered sequence of elements: index: the number assigned to each element in an index, starting at zero, size: the total number of elements that have been added to a list. Elements can be added to the front, back, or elsewhere. In java, a list can be represented as an arraylist or a linkedlist. [hello, abc, goodbye, okay: the list object keeps track of element values that have been added to it, their order, indexes, and its total size. Think of an array list as an automatically resizing array object. Internally, the list is implemented using an array and a size field. Add(value): appends value at end of list. Add(index, value): inserts given value just before the given index, shifting subsequent values to the right.

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