CISC 124 Lecture Notes - Lecture 13: Victorian Railways E Type Carriage, Iter, Iterator

77 views3 pages

Document Summary

Iterator - an object that helps you loop through the collections framework. Ex: arrays, linked lists, arraylists(part of collections framework. Sets - no duplicates, order determined by value. Lists - ordered sequences, program determines positions. Maps - dictionaries, lookup tables (not an extension of. Has additional methods such as, adding, removing shuffling, sorting, etc. Has these static methods: static void shuffle(list l) static void sort(list l) static void sort(list l, comparator c) static object max(collections col) static object max(collections col, comparator comp) static object min(collections col) static object min(collections col, comparator comp) Adding aliases, it does not copy, so if you add the same object to two collections, they are the same object referenced. Set adds only specifications, not methods, such as: Hashset class - very efficient (add, remove, search are constant time) but takes a lot of memory. Hashset(collections c): creates hashset containing all the elements of c. //do this this. addall(that); // where "that" is another hashset.

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