Entrance Exams
Govt. Exams
Vector is a legacy synchronized collection, while ArrayList is unsynchronized but faster. For thread-safety with ArrayList, use Collections.synchronizedList().
TreeMap is based on Red-Black tree, so get(), put(), and remove() operations have O(log n) time complexity due to tree traversal.
LinkedHashSet maintains insertion order using a doubly-linked list. HashSet does not maintain order, TreeSet maintains sorted order, and ConcurrentHashMap doesn't guarantee insertion order.
HashMap uses a hash table with buckets (arrays of linked lists or red-black trees) to store key-value pairs for efficient O(1) average lookup time.
Set interface explicitly does not allow duplicate elements. List allows duplicates, Queue is for ordered collections, and Map stores key-value pairs.
Spliterator provides split() capability enabling efficient parallel stream processing with characteristics advertisement.
LinkedHashMap can be extended and removeEldestEntry() overridden to implement LRU cache eviction policy.
Collections.sort() uses TimSort (hybrid of merge and insertion sort) with O(n log n) worst-case, but QuickSort's worst-case is O(n²).
forEachOrdered() preserves encounter order even in parallel streams, while forEach() doesn't guarantee order.
subList() returns a view (structural reference) to the original list in O(1) time, not a copy.