Kizspy | Question: 40
(Choose 1 answer)
FJOVERFLOW.COM
In a financial application, you need to store unique customer IDs efficiently, ensuring rapid lookup and
insertion. Describe the Java collection you would choose, the reasons behind your choice, and how you
would handle potential duplicates.
A. Choose a TreeSet<Integer> to automatically handle duplicates and ensure quick lookups.
B. Implement a custom CustomerIDManager class with an embedded array for efficient management.
C. Utilize a LinkedHashSet<Integer> to maintain insertion order while ensuring uniqueness.
D. Design a HashMap<Integer, Boolean> where uniqueness is enforced through key existence.
E. Use a BitSet to represent customer IDs with efficient storage.
F. Implement a custom hash table for direct control over insertion and lookup processes.