Sets in Java
From charlesreid1
notes
Sets are easy to implement in Java using hash tables - the value being stored in the hash table serves as its own key. If someone passes an object and says, "Does this object live in your Set?" you pass that object to the hash function, get your index back, go to the hash's big array, and you either get nothing back (in which case, the answer is no, sorry, it is not in our set) or you get an object back - the same object - with the same hash. And the fact that you find something means the answer is, yes, this object is in the set.
So a Set is just an object wrapping a hash table.
Set class in Java API docs: https://github.com/openjdk/jdk7-jdk/blob/master/src/share/classes/java/util/Set.java
AbstractSet class in Java API docs: https://github.com/openjdk/jdk7-jdk/blob/master/src/share/classes/java/util/AbstractSet.java
HashSet class in Java API docs: https://github.com/openjdk/jdk7-jdk/blob/master/src/share/classes/java/util/HashSet.java
TreeSet class in Java API docs: https://github.com/openjdk/jdk7-jdk/blob/master/src/share/classes/java/util/TreeSet.java
flags
Maps and Dictionaries Part of Computer Science Notes
Series on Data Structures
Maps/Dictionaries Maps · Maps/ADT · Maps in Java · Maps/OOP · Maps/Operations and Performance Map implementations: Maps/AbstractMap · Maps/UnsortedArrayMap · Maps/SortedArrayMap Dictionary implementations: Dictionaries/LinkedDict · Dictionaries/ArrayDict
Hashes Hash Maps/OOP · Hash Maps/Operations and Performance Hash Maps/Dynamic Resizing · Hash Maps/Collision Handling with Chaining Hash functions: Hash Functions · Hash Functions/Cyclic Permutation Hash map implementations: Hash Maps/AbstractHashMap · Hash Maps/ChainedHashMap
Skip Lists · Java/ConcurrentSkipList · Java implementations: SkipList
Sets Sets · Sets/ADT · Sets in Java · Sets/OOP · Multisets
|