Yes, but it's really the worst case: if all the elements in the HashSet
have the same hash code (or a hash code leading to the same bucket). With a correctly written hashCode
and a normally distributed key sample, a lookup is O(1).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…