Collections that allow access to an arbitrary element in constant time? I know about ArrayList. And more?

  • And what prevents to read javadoc in which each collection is painted? - Viacheslav
  • 2
    @Viacheslav, I think, it is easier to get acquainted with the basic data structures in general, and not in particulars. Then there will be no such problems. - angry

1 answer 1

  • HashSet - for constant
  • TreeSet - for the logarithm of the number of elements, which is also not bad.