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

42 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+
$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