Java_Collection_Framework_Guide
Java_Collection_Framework_Guide
A. List Implementations
- ArrayList: Dynamic array, fast read operations, slow insert/delete in the middle.
- LinkedList: Doubly linked list, fast insert/delete, slower random access.
- Vector: Synchronized version of ArrayList.
- Stack: LIFO (Last In, First Out) structure, extends Vector.
B. Set Implementations
C. Queue Implementations
- PriorityQueue: Elements are sorted based on priority (natural order or custom comparator).
- ArrayDeque: Efficient double-ended queue (faster than Stack).
D. Map Implementations
A. Conceptual Questions
1. What is the difference between ArrayList and LinkedList?
2. How does HashMap work internally?
3. What are the differences between HashSet and TreeSet?
4. Why is Hashtable synchronized while HashMap is not?
5. What are the advantages of ArrayDeque over Stack?
B. Coding Questions
7. Summary