For ArrayList underlying dataStructure is Array, for LinkedList it is Link object and for HashMap or HashTable it can be an Array Of LinkedList or Tree, what is the datastructure used in HashSet
According to the Javadoc the backing data structure for a HashSet is a HashMap.
The JDK 1.6 code verifies this:
public HashSet() {
map = new HashMap<>();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With