Exam weight Low
Exam weight Low
- A linked structure: nodes holding data and a reference to the next node.
Exam weight Low
Exam weight
High
- Dynamic: grows and shrinks one node at a time; no fixed size.
🎯 How this can come up · 1 question
MCQ
Compared with ArrayList, LinkedList is better at:
Correct: Inserting and removing at the ends or in the middle via an iterator.
Exam weight Low
Exam weight Low
- LinkedList<E> is generic; E = element type.
Exam weight Low
Exam weight
Medium
- Methods: add, addFirst, addLast, getFirst, getLast, removeFirst, removeLast, get, size.
🎯 How this can come up · 1 question
MCQ
Which method inserts at the front of a LinkedList?
Correct: addFirst.
Exam weight Low
Exam weight Low
- Iterators traverse the list: hasNext(), next(); ListIterator goes both ways.
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
- Sort a LinkedList of objects with Collections.sort(list, comparator).
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight
High
- PriorityQueue: poll() always returns the smallest (highest-priority) element.
🎯 How this can come up · 1 question
MCQ
A PriorityQueue<Integer> holding 5, 1, 3: poll() returns:
Correct: 1.
Exam weight Low
No slides match this filter.