Skip to content

Glossary: Data Structures and Algorithms in Java

HashSet

Also written: set, Set

A hash map with keys and no values, so `contains(x)` and `add(x)` are O(1) on average. It is used to track items already seen.

Where the book teaches it

Related terms

hash mapvisited setautoboxing