Set
A set is a collection of unique elements in which membership is determined by whether an element is present, not by duplicate occurrences.
Python How-To
A set is a Python collection of distinct elements without a defined positional order.
- How it is used
- Uses sets for repeated membership checks, unique members, and relationships between collections.
- How deep it goes
- Works through a lookup benchmark and set operations, identifying hash-table storage without implementing it.
- Examples
- Uses recommended-stock lists to test containment and overlap, and task sets to demonstrate set operations.
- What you can do after
- Apply it via Python's built-in set methods to check membership and compare or select members across collections.
Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond
A JavaScript collection type that stores unique values and provides iterable traversal over its elements.
- How it is used
- Keeps unique values for membership-driven tasks, such as tracking rendered tiles or building a card deck.
- How deep it goes
- Works through construction, membership updates, array conversion, and shuffling; stops short of implementing Set internals.
- Examples
- Uses duplicate colors, a tile-rendering loop, and a shuffled card deck.
- What you can do after
- Build it from scratch to maintain unique values, update membership, and convert through an array when ordering operations require one.
Julia as a Second Language
A set is a collection that stores distinct elements without relying on positional order.
- How it is used
- Uses sets to organize overlapping categories and find matching products or bugs by membership and set operations.
- How deep it goes
- Works through creation, membership, operations, and array tradeoffs with applied searches, without detailing a set implementation.
- Examples
- Uses Julia REPL snippets, a screw catalog with overlapping categories, and bug-tracker searches.
- What you can do after
- Build it from scratch: create Julia sets and combine them to select records matching or excluding criteria.
The Well-Grounded Data Analyst
A set is an unordered collection of distinct elements that supports membership testing and set operations.
- How it is used
- Uses sets to validate schemas and compare cleaned reference lists during exploratory data analysis.
- How deep it goes
- Demonstrates intersection and difference through short Python expressions, stopping short of set internals or formal operation details.
- Examples
- Compares survey columns with dictionary question names and cities with customer city labels.
- What you can do after
- Apply it via Python to identify shared or unmatched values in analytical datasets.
Fast Python: High performance techniques for large datasets
- How it is used
- Replaces a repeatedly searched list when the question is whether a known value occurred.
- How deep it goes
- Tests duplicate removal and equal-size lookup, then gives an intuitive hash explanation without detailing hash-function design.
- Examples
- Benchmarks membership in station temperatures and in list and set collections of 100,000 distinct integers.
- What you can do after
- Apply it via Python’s built-in `set` for repeated membership checks, while choosing ordered-list bisection for suitable interval searches.
Read how Fast Python: High performance techniques for large datasets explains set →
Python Workout, Second Edition
A set is an unordered collection of distinct hashable values in Python.
- How it is used
- Deploys sets for uniqueness, membership lookup, dictionary-key comparison, and sequence-based data-cleaning exercises.
- How deep it goes
- Works through construction, mutation, set operators, subset testing, and list-hashability mistakes without descending into implementation internals.
- Examples
- Uses duplicate numbers, dictionary-key diffs, unique words in files, server logs, directory extensions, and vowel detection.
- What you can do after
- Apply it via Python's built-in set operations to deduplicate sequences, compare collections, and count distinct values.
100 Java Mistakes and How to Avoid Them
A set is a collection abstraction that stores distinct elements without duplicate membership.
- How it is used
- Uses sets to expose equality, null-search, and mutation mistakes in Java collection code.
- How deep it goes
- Explains equality contracts, null dispositions, and hash-bucket lookup consequences through focused failure cases.
- Examples
- Demonstrates Set.of() migration and a mutated List<String> that HashSet can no longer find.
- What you can do after
- Diagnose/debug with it by guarding null lookups and identifying mutated hash-based set elements.
Read how 100 Java Mistakes and How to Avoid Them explains set →
ScyllaDB in Action
A set is a collection data type that stores distinct elements without associating them with keys.
- How it is used
- Models a restaurant article’s gallery as a collection of distinct image values.
- How deep it goes
- Explains declaration, literals, queries, addition, removal, and idempotency, while deferring large or unbounded collections to tables.
- Examples
- Demonstrates text sets {'a', 'b', 'c'} and an article image gallery typed SET<FROZEN<image>>.
- What you can do after
- Apply CQL set literals and + or - updates to store distinct, repeat-safe collection values.
Python Workout: 50 ten-minute exercises
A set is a Python collection of distinct, unordered elements.
- How it is used
- Uses sets to enforce uniqueness, perform membership lookups, compare dictionary keys, and summarize repeated input values.
- How deep it goes
- Explains construction, mutation, uniqueness, hashability, key union, and practical use, without descending into implementation internals.
- Examples
- Demonstrates duplicate-number removal, dictionary-key differences, unique-word counting, log analysis, file extensions, and vowel-based word filtering.
- What you can do after
- Apply it via Python's set, add, update, union, and length operations to deduplicate data and compare collections.
Read how Python Workout: 50 ten-minute exercises explains set →
Grokking Algorithms, Second Edition
A set is a collection that stores distinct elements without assigning significance to their insertion order.
- How it is used
- Tracks unique items and prevents repeated processing in graph searches, shortest-path algorithms, and greedy coverage selection.
- How deep it goes
- Defines uniqueness and demonstrates union, intersection, difference, and algorithmic tracking without examining set internals.
- Examples
- Uses duplicate numbers, fruit and vegetable collections, graph-processing records, and radio-station coverage sets.
- What you can do after
- Apply it via Python to remove duplicates, compare collections, and record items or nodes already handled.
The Well-Grounded Rubyist, Fourth Edition
A set is a collection data structure that stores distinct values without representing them as an indexed sequence.
- How it is used
- Organizes unique values and supports membership relationships and set algebra within Ruby’s collection toolkit.
- How deep it goes
- Explains construction, transformation, mutation, algebra, and subset testing, while deferring deeper Enumerable behavior.
- Examples
- Uses state names, transformed personal names, duplicate insertion, set algebra, merging, and subset comparisons.
- What you can do after
- Apply it via Ruby’s Set class to create unique collections, mutate membership, compare sets, and perform set algebra.
Read how The Well-Grounded Rubyist, Fourth Edition explains set →
Secrets of the JavaScript Ninja, Second Edition
A JavaScript collection of unique values.
- How it is used
- Uses sets to represent collections of distinct items and avoid duplicate entries.
- How deep it goes
- Defines object-based imitations and demonstrates Set creation, membership, insertion, size, and iteration, while only foreshadowing set operations.
- Examples
- Demonstrates a set of ninja names, repeated entries, membership checks, additions, size, and insertion-order iteration.
- What you can do after
- Apply the built-in Set constructor to retain unique values, check membership, add items, inspect size, and iterate.
Read how Secrets of the JavaScript Ninja, Second Edition explains set →
Tiny Python Projects: Learn coding and testing with puzzles and games
A set is a collection that contains distinct elements without assigning significance to their order.
- How it is used
- Uses sets to collect unique words while generating passwords from one or more input files.
- How deep it goes
- Explains creation, insertion, deduplication, display, and intersection, while deferring the wider set API to documentation.
- Examples
- Demonstrates unique words from files and shared numbers from overlapping integer ranges.
- What you can do after
- Apply it via Python to deduplicate processed data and find shared values between collections.
Read how Tiny Python Projects: Learn coding and testing with puzzles and games explains set →
Spring in Action, Sixth Edition
A set is a collection that stores distinct elements without permitting duplicates.
- How it is used
- Uses sets to guarantee unique ingredient references in reactive Taco persistence.
- How deep it goes
- Explains uniqueness, HashSet initialization, ID references, and array persistence, but does not develop set internals.
- Examples
- Demonstrates Set<Long> ingredient IDs in Taco and an ingredient_ids database array.
- What you can do after
- Apply sets via Java HashSet to prevent duplicate ingredient IDs in a Spring Data R2DBC entity.
Coding with AI
A set is an unordered collection data structure that stores unique elements and supports efficient membership operations.
- How it is used
- Uses uniqueness to generate a randomized collection of question IDs for an application workflow.
- How deep it goes
- Explains uniqueness through a repeated-selection implementation but stops short of detailed set internals.
- Examples
- Demonstrates selecting 35 unique question IDs from database results and updating an application call.
- What you can do after
- Apply via Python to collect unique values while checking input availability and returned data shape.
Related concepts
- set unionproduced by · Set union is the operation that produces a set containing every element belonging to at least one of its operand sets.
- MapSetincludes · MapSet is an Elixir collection implementing a set of unique values of any type.
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.














