Setzen Sie die Java -Zeitkomplexität
For HashSet, LinkedHashSet, and EnumSet the add(), remove() and contains() operations cost constant O(1) time. Thanks to the internal HashMap implementation.
Kelsier