What standard containers allow you to find an element in them by its value for O (log (n))?
Answer 1, Authority 100%
hashset / hashmap has asymptotics O (1) at best, in the case of conflicts, there works or a list or tree (if the values in one node are greater than 8, if not mistaken) and in this case it may well succeed and O (log ( n)) in the worst case.
If you need a collection that an average of O (log (n)), TreeSet / TreeMap is built on a tree, therefore most likely we are talking about them. Or do you need all possible containers in Java with access to O (log (n))? Interested in collections from any guava and apache (all sorts of Patriciatrie and TreeList) or speech only about JDK?
If you are interested in more about the collection, look this article .