Is a hashCode method which returns unique value for every object the most efficient one?
If yes, why? As per my understanding, if hashCode returns unique value for every object, then to find the appropriate bucket we have to compare the hashCode with that of every other object and this will give an O(n) time.