liveBook · Manning

Hashset

A hash set is a collection of distinct values that uses hashing to support efficient membership testing without associated values.

How 2 Manning books explain it

Fabulous Adventures in Data Structures and Algorithms

HashSet<T> is a .NET collection type that stores unique values and supports hash-based membership and lookup operations.

How it is used
Supports fast word-membership tests while serving as a rejected alternative for prefix-oriented word-list searches.
How deep it goes
Explains hashing, buckets, complexity, equality contracts, and mutation hazards, but stops short of implementing the collection itself.
Examples
Uses large word lists, Contains, StartsWith, and structurally equivalent mutable graph nodes as examples.
What you can do after
Evaluate hash sets for membership workloads and implement compatible equality and hashing for stored objects.

Read how Fabulous Adventures in Data Structures and Algorithms explains hashset →

Kotlin in Action, 2E

HashSet is a set implementation that organizes elements using hash codes for efficient membership testing.

How it is used
Uses hash codes to implement set membership checks, especially when storing objects with value-based equality.
How deep it goes
Explains hash-first comparison and the equals/hashCode contract, then stops short of implementation internals beyond a hashCode example.
Examples
Uses two equal-looking Customer instances named Alice and compares Kotlin hashSetOf with java.util.HashSet interoperability.
What you can do after
Diagnose membership failures by checking whether equal objects return the same hash code.

Read how Kotlin in Action, 2E explains hashset →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.