Conceptintro
Set
Also called set, hash set, sorted set, frozenset, HashSet, TreeSet, Set, HashSet<T>, unordered_set, BTreeSet, set type, finite set.
A set holds distinct values with no order. Its main operation is a test of whether a value is in the set, and it also gives union, intersection and difference.
- Applies to
- core-languages
Idea
A set is a collection of values in which each value occurs once. Wikipedia defines it as "an abstract data type that can store distinct values, without any particular order"1. A list answers the question: what is at position 3? A set answers a different question: is this value in the collection? In the words of Wikipedia, "rather than retrieving a specific element from a set, one typically tests a value for membership in a set"1.
A program uses a set to remember which items it has seen, to remove duplicates, and to compare two groups of items: which items are in both, and which are in only one.
# A set keeps one copy of each value, and it has no order.
s = {3, 1, 3, 2, 1}
print(len(s), s == {1, 2, 3}, 2 in s, 5 in s)
# add ignores a value that is there already.
s.add(2)
s.add(4)
print(sorted(s))
# The operations of set algebra.
a, b = {1, 2, 3}, {2, 3, 4}
print(sorted(a | b), sorted(a & b), sorted(a - b), sorted(a ^ b))
print({2, 3} <= a, a.isdisjoint({7, 8}))
3 True True False
[1, 2, 3, 4]
[1, 2, 3, 4] [2, 3] [1] [1, 4]
True True
The literal {3, 1, 3, 2, 1} has five items but makes a set of three values. Two sets are equal when they have the same values, in any order. The example prints sorted lists because a set has no order of its own.
How it works
Equal values are one value. A set decides that two values are the same with the equality of the language. Java says a set contains "no pair of elements e1 and e2 such that e1.equals(e2)"2. So the rules for set elements are the same as the rules for map keys: a hash set needs a hash code that agrees with equality, and a sorted set needs an order. See map and dictionary and value equality and identity.
A set is a map with no values. Most languages build a set from the same parts as a map. Java HashSet is "backed by a hash table (actually a HashMap instance)"3. Rust HashSet is "implemented as a HashMap where the value is ()"4. Wikipedia says that sets "are commonly implemented in the same way as (partial) maps (associative arrays)"1. So a hash set tests membership in constant time on average, and a tree set in logarithmic time. See hash table.
The operations. A set has the operations of set algebra. Wikipedia lists union, intersection, difference and subset: "union(S,T): returns the union of sets S and T"1, and "subset(S,T): a predicate that tests whether the set S is a subset of set T"1. Python has operators for them: |, &, -, ^ and <=. JavaScript added methods: union "Takes a set and returns a new set containing elements which are in either or both of this set and the given set"5. In Java and C#, the methods addAll, retainAll, UnionWith and IntersectWith change the set in place.
Mutable and frozen sets. A set that can change cannot be an element of another set or a key of a map, because its hash would change. Python has two types. The type set can change, and "Since it is mutable, it has no hash value and cannot be used as either a dictionary key or as an element of another set"6. The type frozenset cannot change after the program makes it, so "it can therefore be used as a dictionary key or as an element of another set"6. Java Set.of and C# FrozenSet are also sets that do not change.
In languages
| Language | Verdict | Note |
|---|---|---|
| Python | Native | |
| C++ | Standard library | |
| Java | Standard library | |
| C | Idiom | |
| C# | Standard library | |
| JavaScript | Native | |
| TypeScript | Native | TypeScript uses the JavaScript Set with the type Set<T> and ReadonlySet<T>. The ES2025 set methods need the lib setting ES2025 or later. No example file exists. |
| Go | Idiom | |
| Rust | Standard library | |
| Kotlin | Standard library | SetOf makes a read-only set and mutableSetOf a mutable one, both a LinkedHashSet that keeps insertion order. union, intersect and subtract are infix functions. No example file exists because kotlinc is not installed. |
| SQL | Native | A query result is a bag of rows. SELECT DISTINCT removes duplicates, and UNION, INTERSECT and EXCEPT are set operations on query results. A UNIQUE constraint keeps a column free of duplicates. |
| Bash | Idiom | Bash has no set type. An associative array with the elements as keys is a set, and the test -v tells whether an element is there. No example file exists. |
| PowerShell | Standard library | PowerShell uses the .NET class System.Collections.Generic.HashSet, made with [System.Collections.Generic.HashSet[string]]::new(). A hash table with the elements as keys also works. No example file exists because pwsh is not installed. |
| HTML | Does not apply | HTML is markup. The class attribute holds a set of class names, but it is text, not a set value. |
| CSS | Does not apply | CSS has no set values. A selector list matches the union of what each selector matches, but it is a rule, not data. |
| Regular expressions | Idiom | A character class such as [aeiou] is a set of characters, and [^aeiou] is its complement. Some engines also have set operations on classes, such as intersection with && in Java. |
| Language | Verdict | Mechanism |
|---|---|---|
| Python | native | set and frozenset; the literal {1, 2}; the operators |, &, -, ^ and <= |
| JavaScript | native | Set in insertion order, with SameValueZero; union, intersection and the other ES2025 methods |
| TypeScript | native | the JavaScript Set<T> and ReadonlySet<T> |
| Java | stdlib | the interface Set with HashSet, LinkedHashSet and TreeSet; Set.of for a fixed set |
| Kotlin | stdlib | setOf and mutableSetOf (a LinkedHashSet); union, intersect and subtract |
| C# | stdlib | HashSet<T>, SortedSet<T> and FrozenSet<T>; UnionWith, IntersectWith, SetEquals |
| Go | idiom | no set type; map[T]struct{} or map[T]bool |
| Rust | stdlib | HashSet<T> and BTreeSet<T>; the operators |, &, - and ^ on references |
| C | idiom | no set type; a bit set in an integer, a sorted array or a hand-written hash table |
| C++ | stdlib | std::set (sorted) and std::unordered_set (hash); std::set_intersection on sorted ranges |
| Bash | idiom | an associative array with the elements as keys |
| PowerShell | stdlib | the .NET HashSet[T]; a hash table with the elements as keys |
| SQL | native | SELECT DISTINCT; UNION, INTERSECT and EXCEPT on query results |
| Regex | idiom | a character class such as [aeiou] is a set of characters |
| HTML | n/a | markup; the class attribute is a list of names in text |
| CSS | n/a | no set values; a selector list matches a union, but it is a rule |
Python has a set literal, and Wikipedia notes the trap in it: "empty sets must be created using set(), because Python uses {} to represent the empty dictionary"1. In Python, "A set object is an unordered collection of distinct hashable objects. Common uses include membership testing, removing duplicates from a sequence, and computing mathematical operations such as intersection, union, difference, and symmetric difference"6.
JavaScript Set keeps the insertion order: "A value in the set may only occur once; it is unique in the set's collection. You can iterate through the elements of a set in insertion order"5. C# describes HashSet<T> as "a collection that contains no duplicate elements, and whose elements are in no particular order"7. C++ has both kinds: "std::set is an associative container that contains a sorted set of unique objects of type Key"8, and for std::unordered_set, "Search, insertion, and removal have average constant-time complexity"9.
Go has no set type. The Go blog suggests a map: "a map of boolean values can be used as a set-like data structure (recall that the zero value for the boolean type is false)"10. A map[T]struct{} does the same and stores nothing for each value.
The example files show these forms. Python shows set() and {}, remove and discard, a frozenset inside a set, and the difference between the methods and the operators. JavaScript shows NaN, arrays by identity and the ES2025 methods. Java shows add with its result, TreeSet, the in-place methods, Set.of with a duplicate and a list that changes inside a HashSet. C# uses a comparer that ignores case, SortedSet and SetEquals. Go writes a generic set type on a map. Rust uses the set operators and BTreeSet::range. C keeps a set of small integers in the bits of a 64-bit word. C++ uses std::set, the sorted range algorithms and lower_bound.
# {} is an empty dict. An empty set needs set().
print(type({}).__name__, type(set()).__name__)
# remove raises KeyError for a missing value, and discard does not.
s = {1, 2, 3}
s.discard(9)
try:
s.remove(9)
except KeyError:
print("KeyError")
# Elements must be hashable. A frozenset can be an element, and a set cannot.
pairs = {frozenset({1, 2}), frozenset({2, 1})}
print(len(pairs))
try:
{{1, 2}}
except TypeError as e:
print(type(e).__name__)
# Equal values are one element: 1, 1.0 and True are equal.
print(len({1, 1.0, True}))
# A set removes duplicates but loses the order. dict.fromkeys keeps the first order.
words = ["b", "a", "b", "c", "a"]
print(sorted(set(words)), list(dict.fromkeys(words)))
# The methods take any iterable, and the operators need sets.
print(sorted(s.union([4, 5])))
try:
s | [4, 5]
except TypeError as e:
print(type(e).__name__)
# A frozenset cannot change.
f = frozenset(s)
print(hasattr(f, "add"), f == s)
dict set
KeyError
1
TypeError
1
['a', 'b', 'c'] ['b', 'a', 'c']
[1, 2, 3, 4, 5]
TypeError
False True
- Verdict: native. set is mutable and frozenset is immutable and hashable. {} is an empty dict, so an empty set needs set(). remove raises KeyError and discard does not. 1, 1.0 and True are one element. The methods such as union take any iterable, and the operators such as | need sets.
#include <algorithm>
#include <iostream>
#include <iterator>
#include <set>
#include <string>
#include <unordered_set>
#include <vector>
template <class C>
void show(const std::string& name, const C& c) {
std::cout << name;
for (int v : c) std::cout << " " << v;
std::cout << "\n";
}
int main() {
// std::set keeps unique values in sorted order.
std::set<int> s{3, 1, 3, 2, 1};
show("set", s);
// insert returns a pair: an iterator and whether the value was new.
auto [it, added] = s.insert(2);
std::cout << *it << " " << added << " " << s.insert(4).second << "\n";
// contains (C++20), and erase returns the number of values removed.
std::cout << s.contains(4) << " " << s.erase(4) << " " << s.erase(9) << "\n";
// The set algorithms work on sorted ranges, so they fit std::set.
std::set<int> a{1, 2, 3}, b{2, 3, 4};
std::vector<int> out;
std::set_intersection(a.begin(), a.end(), b.begin(), b.end(), std::back_inserter(out));
show("intersection", out);
out.clear();
std::set_symmetric_difference(a.begin(), a.end(), b.begin(), b.end(), std::back_inserter(out));
show("symmetric", out);
std::set<int> sub{2, 3};
std::cout << std::includes(a.begin(), a.end(), sub.begin(), sub.end()) << "\n";
// An unordered_set is a hash set. Copy it to a sorted vector to print it.
std::unordered_set<int> h{5, 1, 5, 3};
std::vector<int> v(h.begin(), h.end());
std::sort(v.begin(), v.end());
show("unordered", v);
// A sorted set can find the first value not less than x.
std::cout << *a.lower_bound(2) << "\n";
}
set 1 2 3
2 0 1
1 1 0
intersection 2 3
symmetric 1 4
1
unordered 1 3 5
2
- Verdict: stdlib. std::set keeps sorted unique values, and std::unordered_set is a hash set. insert returns whether the value was new, and erase returns the number removed. set_intersection, set_symmetric_difference and includes work on sorted ranges.
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
public class Main {
public static void main(String[] args) {
// add returns false when the set has the element already.
Set<String> s = new HashSet<>();
System.out.println(s.add("a") + " " + s.add("a") + " " + s.size());
// A TreeSet keeps its elements sorted, and a HashSet has no defined order.
Set<Integer> sorted = new TreeSet<>(List.of(3, 1, 2));
System.out.println(sorted);
// Set algebra changes the set in place, so copy it first.
Set<Integer> a = new TreeSet<>(List.of(1, 2, 3));
Set<Integer> b = Set.of(2, 3, 4);
Set<Integer> union = new TreeSet<>(a);
union.addAll(b);
Set<Integer> inter = new TreeSet<>(a);
inter.retainAll(b);
Set<Integer> diff = new TreeSet<>(a);
diff.removeAll(b);
System.out.println(union + " " + inter + " " + diff + " " + a.containsAll(Set.of(2, 3)));
// Set.of rejects duplicate elements.
try {
Set.of("x", "x");
} catch (IllegalArgumentException e) {
System.out.println("IllegalArgumentException");
}
// A mutable element that changes is lost: its hash code no longer matches its bucket.
List<Integer> key = new ArrayList<>(List.of(1, 2));
Set<List<Integer>> lists = new HashSet<>();
lists.add(key);
key.add(3);
System.out.println(lists.contains(key) + " " + lists.contains(List.of(1, 2)) + " " + lists.size());
}
}
true false 1
[1, 2, 3]
[1, 2, 3, 4] [2, 3] [1] true
IllegalArgumentException
false false 1
- Verdict: stdlib. add returns false for an element that is there already. TreeSet keeps the elements sorted. addAll, retainAll and removeAll change the set in place, so the example copies it first. Set.of rejects duplicates. A list that changes after it goes into a HashSet is not found again.
#include <stdint.h>
#include <stdio.h>
/* A set of small integers 0..63 as the bits of one 64-bit word. */
typedef uint64_t set64;
static set64 add(set64 s, int v) { return s | (UINT64_C(1) << v); }
static int has(set64 s, int v) { return (s >> v) & 1; }
static void show(const char *name, set64 s) {
printf("%s {", name);
const char *sep = "";
for (int v = 0; v < 64; v++) {
if (has(s, v)) {
printf("%s%d", sep, v);
sep = " ";
}
}
printf("}\n");
}
static int count(set64 s) {
int n = 0;
for (; s; s &= s - 1) n++; /* clear the lowest bit each time */
return n;
}
int main(void) {
set64 a = 0, b = 0;
int as[] = {1, 2, 3, 3}, bs[] = {2, 3, 4};
for (int i = 0; i < 4; i++) a = add(a, as[i]);
for (int i = 0; i < 3; i++) b = add(b, bs[i]);
printf("%d %d %d\n", count(a), has(a, 2), has(a, 5));
/* Each set operation is one machine instruction on the words. */
show("union", a | b);
show("intersection", a & b);
show("difference", a & ~b);
show("symmetric", a ^ b);
printf("subset %d\n", (add(add(0, 2), 3) & ~a) == 0);
return 0;
}
3 1 0
union {1 2 3 4}
intersection {2 3}
difference {1}
symmetric {1 4}
subset 1
- Verdict: idiom. C has no set type. A set of the integers 0 to 63 fits in the bits of one uint64_t, and union, intersection and difference are one bitwise operation each. Larger sets use an array of words, a hash table or a sorted array.
using System;
using System.Collections.Generic;
using System.Linq;
// Add returns false when the set has the element already.
var s = new HashSet<string>();
Console.WriteLine($"{s.Add("a")} {s.Add("a")} {s.Count}");
// A comparer decides which elements are equal. This set ignores case.
var names = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "Ada", "ADA", "ada" };
Console.WriteLine($"{names.Count} {names.Contains("aDa")}");
// UnionWith, IntersectWith and ExceptWith change the set in place.
var a = new SortedSet<int> { 3, 1, 2 };
var b = new[] { 2, 3, 4 };
var union = new SortedSet<int>(a);
union.UnionWith(b);
var inter = new SortedSet<int>(a);
inter.IntersectWith(b);
var diff = new SortedSet<int>(a);
diff.ExceptWith(b);
Console.WriteLine($"{string.Join(",", union)} {string.Join(",", inter)} {string.Join(",", diff)}");
// SetEquals ignores order and duplicates. SequenceEqual does not.
Console.WriteLine($"{a.SetEquals(new[] { 2, 1, 3, 3 })} {a.SequenceEqual(new[] { 2, 1, 3 })}");
// A SortedSet can give the elements in a range.
Console.WriteLine(string.Join(",", union.GetViewBetween(2, 3)));
True False 1
1 True
1,2,3,4 2,3 1
True False
2,3
- Verdict: stdlib. HashSet and SortedSet. Add returns false for an element that is there already. A comparer such as StringComparer.OrdinalIgnoreCase decides which elements are equal. UnionWith, IntersectWith and ExceptWith change the set in place. SetEquals ignores order and duplicates, and GetViewBetween gives a range of a SortedSet.
// A Set keeps each value once, in insertion order.
const s = new Set([3, 1, 3, 2, 1]);
console.log(s.size, [...s], s.has(2), s.has(5));
// add returns the set, so calls chain. A value that is there already is ignored.
s.add(2).add(4);
console.log([...s]);
// Values are compared with SameValueZero: NaN is one value, and 0 and -0 are one value.
const n = new Set([NaN, NaN, 0, -0]);
console.log(n.size, n.has(NaN));
// Objects are compared by identity, so two equal-looking arrays are two elements.
const arrays = new Set([[1, 2], [1, 2]]);
console.log(arrays.size);
// Set methods for set algebra (ES2025).
const a = new Set([1, 2, 3]);
const b = new Set([2, 3, 4]);
console.log([...a.union(b)], [...a.intersection(b)], [...a.difference(b)], [...a.symmetricDifference(b)]);
console.log(new Set([2, 3]).isSubsetOf(a), a.isDisjointFrom(new Set([7, 8])));
// A Set removes duplicates from an array and keeps the first order.
console.log([...new Set(["b", "a", "b", "c", "a"])]);
3 [ 3, 1, 2 ] true false
[ 3, 1, 2, 4 ]
2 true
2
[ 1, 2, 3, 4 ] [ 2, 3 ] [ 1 ] [ 1, 4 ]
true true
[ 'b', 'a', 'c' ]
- Verdict: native. A Set keeps each value once, in insertion order, and compares values with SameValueZero, so NaN is one value. Arrays and objects are elements by identity. ES2025 adds union, intersection, difference, symmetricDifference, isSubsetOf and isDisjointFrom.
package main
import (
"fmt"
"maps"
"slices"
)
// Go has no set type. A map with struct{} values is a set, and struct{} takes no memory.
type Set[T comparable] map[T]struct{}
func (s Set[T]) Add(v T) { s[v] = struct{}{} }
func (s Set[T]) Has(v T) bool { _, ok := s[v]; return ok }
func Of[T comparable](vs ...T) Set[T] {
s := Set[T]{}
for _, v := range vs {
s.Add(v)
}
return s
}
func main() {
s := Of(3, 1, 3, 2, 1)
fmt.Println(len(s), s.Has(2), s.Has(5))
// A map of bool also works, because a missing key gives false.
seen := map[string]bool{}
for _, w := range []string{"b", "a", "b"} {
if seen[w] {
fmt.Println("repeat:", w)
}
seen[w] = true
}
// Set algebra is a loop. Sort the keys to print them, because map order is random.
a, b := Of(1, 2, 3), Of(2, 3, 4)
inter := Set[int]{}
for v := range a {
if b.Has(v) {
inter.Add(v)
}
}
union := maps.Clone(a)
maps.Copy(union, b)
fmt.Println(slices.Sorted(maps.Keys(union)), slices.Sorted(maps.Keys(inter)))
// delete removes an element, and deleting a missing element does nothing.
delete(s, 1)
delete(s, 9)
fmt.Println(slices.Sorted(maps.Keys(s)))
}
3 true false
repeat: b
[1 2 3 4] [2 3]
[2 3]
- Verdict: idiom. Go has no set type. A map[T]struct{} is a set with no memory for the values, and a map[T]bool also works because a missing key gives false. Set algebra is a loop, and the order of a loop over a map is not defined, so the example sorts the keys.
use std::collections::{BTreeSet, HashSet};
fn main() {
// insert returns false when the set has the value already.
let mut s: HashSet<i32> = HashSet::from([3, 1, 3, 2, 1]);
println!("{} {} {} {}", s.len(), s.insert(2), s.insert(4), s.contains(&4));
// A BTreeSet keeps its values sorted, and a HashSet has no order.
let a: BTreeSet<i32> = BTreeSet::from([1, 2, 3]);
let b: BTreeSet<i32> = BTreeSet::from([2, 3, 4]);
println!("{:?}", a);
// The operators work on references and make a new set.
println!("{:?} {:?} {:?} {:?}", &a | &b, &a & &b, &a - &b, &a ^ &b);
println!("{} {}", BTreeSet::from([2, 3]).is_subset(&a), a.is_disjoint(&BTreeSet::from([7, 8])));
// The method forms are lazy iterators.
let common: Vec<_> = a.intersection(&b).copied().collect();
println!("{:?}", common);
// A sorted set can give the values in a range.
println!("{:?}", a.range(2..).collect::<Vec<_>>());
// remove returns whether the value was there.
println!("{} {}", s.remove(&1), s.remove(&9));
}
3 false true true
{1, 2, 3}
{1, 2, 3, 4} {2, 3} {1} {1, 4}
true true
[2, 3]
[2, 3]
true false
- Verdict: stdlib. HashSet and BTreeSet. insert and remove return whether the set changed. The operators |, &, - and ^ take two references and make a new set. intersection and the other methods give lazy iterators. A BTreeSet keeps the values sorted and gives ranges.
Variations and related ideas
- Sorted sets. A tree set, such as Java
TreeSet, RustBTreeSetor C++std::set, keeps the values in order. It can give the values in a range and find the next value after a given value. See ordered map. - Insertion-ordered sets. JavaScript
Set, JavaLinkedHashSetand KotlinsetOfkeep the order in which the values were added. Pythonsetdoes not, butdict.fromkeys(items)keeps the first order of each value. See remove duplicates from a list. - Bit sets. A set of small integers fits in the bits of a word or an array of words. "a subset of the integers 1,2,...,n can be implemented efficiently as an n-bit bit array, which also support very efficient union and intersection operations"1. Java
BitSet, C++std::bitsetand the C example use this form. - Multisets. A multiset, or bag, counts how many times each value occurs. "A multiset is a special kind of set in which an element can appear multiple times in the set"1. See multiset.
- Probabilistic sets. A Bloom filter answers membership with a small chance of a wrong yes, and it takes much less memory than a set. "A Bloom map implements a set probabilistically, using a very compact representation but risking a small chance of false positives on queries"1.
- Enum sets. Java
EnumSetand C# flag enums store a set of the values of an enumeration as bits.
Pitfalls
- The empty literal. In Python,
{}is an empty dict, not an empty set. Useset(). - Order. A hash set has no order. Java
HashSet"makes no guarantees as to the iteration order of the set; in particular, it does not guarantee that the order will remain constant over time"3. A test that prints a set can fail. Sort the values, or use a sorted or insertion-ordered set. - Elements that change. Java warns: "The behavior of a set is not specified if the value of an object is changed in a manner that affects equals comparisons while the object is an element in the set"2. In the Java example, a list changes after it goes into a
HashSet, and thencontainsreturns false for it. Use immutable elements, such as tuples and frozensets in Python or records in Java. - Identity, not value. In JavaScript, two arrays with the same items are two elements of a
Set, because objects are compared by identity. A C# or Java class withoutEqualsandGetHashCode, orequalsandhashCode, has the same problem. Use a string key, a record or a custom comparer. - In-place operations. Java
retainAlland C#IntersectWithchange the set that the program calls them on. Copy the set first if the program needs the original. - Membership in a list. A test such as
x in itemson a list is a linear search. In a loop, it makes the whole loop quadratic. Make a set from the list once and test against the set. - Operators and iterables. In Python, "the non-operator versions of union(), intersection(), difference(), symmetric_difference(), issubset(), and issuperset() methods will accept any iterable as an argument. In contrast, their operator based counterparts require their arguments to be sets"6. So
s.union([4, 5])works ands | [4, 5]raisesTypeError.
Cost
| Operation | Hash set | Tree set | Sorted array | Bit set (values below n) |
|---|---|---|---|---|
| membership test | constant on average | logarithmic | logarithmic (binary search) | constant |
| add or remove | constant on average | logarithmic | linear | constant |
| union or intersection of sizes m and n | linear in m + n | linear in m + n | linear in m + n (merge) | linear in n / 64 |
| loop in sorted order | needs a sort | linear | linear | linear in n / 64 |
| memory | the values and empty slots | the values and links | the values | n bits |
MDN notes that has on a Set "is, on average, faster than the Array.prototype.includes method when an array has a length equal to a set's size"5. For a few values, a small array can still be the faster choice, because it needs no hashing.
History
Wikipedia states that "One of the earliest languages to support sets was Pascal"1. Pascal sets were bit sets of a small range of values. Later languages put general sets in their libraries: Java HashSet and TreeSet in the Collections Framework, C++ std::set and, from C++11, std::unordered_set1. "Python has built-in set and frozenset types since 2.4, and since Python 3.0 and 2.7, supports non-empty set literals using a curly-bracket syntax"1. JavaScript added Set in ES2015 and the set algebra methods in ES2025. Go still has no set type, and programs use maps.
References
- Set (abstract data type), Wikipedia, Introduction; Operations; Implementations; Language support
- Interface Set, Java SE 25 API, Description
- Class HashSet, Java SE 25 API, Description
- Struct HashSet, The Rust Standard Library, Description
- Set, MDN Web Docs, Description; Set composition
- Built-in Types, The Python Standard Library, Set Types, set, frozenset
- HashSet<T> class, .NET API reference, Remarks
- std::set, cppreference.com, Description
- std::unordered_set, cppreference.com, Description
- Andrew Gerrand, Go maps in action, The Go Blog, 2013, Exploiting zero values
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag Q9BDY4 Edit this page History Report an error Markdown