r/ProgrammerTIL • • Oct 22 '17

Other [Java] HashSet<T> just uses HashMap<T, Object> behind the scenes

76 Upvotes

35 comments sorted by

View all comments

Show parent comment

2

u/xonjas Oct 22 '17

Ruby uses hashes under the hood also.

Sets are tables with constraints added, it makes sense to use tables to implement them.