Data Structures and Collections in Java

Slides

Code examples

  1. Use cases for  ArrayList, HashMap, Iterator, Random, Comparable  (in  Java 5)
  2. HashMap example - frequencies  (in Java 5)

Home reading

  1. The collections framework in Java documentation
  2. Object basics and simple data objects, in Java Tutorial (General OOP, preliminary reading)
  3. Collections, in Java Tutorial
  4. Arrays, vectors, etc., by David Eck
  5. Generic programming, by David Eck (Suggested reading and exercises)
  6. Vectors, hashtables, and enumerations, by Dick Baldwin (Legacy API)
  7. Generics tutorial, by Gilad Bracha (Java 5 specific, advanced)

Practice

Write static methods to calculate union and intersection of  two sets (of type HashSet).


Jaanus Pöial, 2006