liveBook · Manning

Hashset

Also called hash set

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 →

Also covered in

What to know first

Related concepts

Questions about hashset

What is hashset?

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

Which Manning books explain hashset?

Fabulous Adventures in Data Structures and Algorithms and Kotlin in Action, 2E.

What should I know before learning hashset?

Manning books that teach hashset usually introduce Map first.

What is the difference between hashset and bloom filter?

A hash set is a collection of distinct values that uses hashing to support efficient membership testing without associated values. A Bloom filter is a space-efficient probabilistic data structure for testing set membership that permits false positives but not false negatives.

What is hashset a kind of?

Hashset is a kind of Map. A map is an associative data structure that stores key-value associations and supports retrieving values by key.

What is hashset also called?

Hashset is also called hash set.

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.