Glossary: Data Structures and Algorithms
Set
Also written: sets
A hash map with keys and no values, so adding and testing `x in my_set` are O(1) on average. A `seen` set turns O(n²) duplicate and pair checks into one O(n) pass.
Glossary: Data Structures and Algorithms
Also written: sets
A hash map with keys and no values, so adding and testing `x in my_set` are O(1) on average. A `seen` set turns O(n²) duplicate and pair checks into one O(n) pass.