Linked Lists Introduction
- 28Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
28 questions
- 1A linked list is a type of_____made up of many nodes.
Hint
Consider the category of structures used to organize data in programming.
Answer
data structure
- 2A_____is a container for some data and a reference to the next node in a linked list.
Hint
Think of the individual elements that make up a linked list.
Answer
node
- 3In a linked list, the first node is called the_____.
Hint
Think of the starting point of the list.
Answer
head
- 4The last node in a linked list is called the_____.
Hint
Think of the opposite end from the head.
Answer
tail
- 5A linked list is an inherently_____data structure, meaning nodes have a sequential order.
Hint
Contrast with unordered structures like sets.
Answer
ordered
- 6An array stores its elements_____in memory, meaning they are placed right next to each other.
Hint
Think about how array elements are laid out physically in RAM.
Answer
contiguously
- 7Inserting an element in the middle of an array has a time complexity of_____in the worst case.
Hint
Consider the need to shift elements after the insertion point.
Answer
O(n)
- 8Inserting a node into a linked list by adjusting pointers takes_____time.
Hint
Think about how many pointer changes are needed regardless of list length.
Answer
O(1)
- 9In an iterative linked list traversal, we use a variable called_____that starts at the head and is updated to
current.next.Hint
It holds a reference to the node currently being processed.
Answer
current
- 10A common mistake in traversal is checking_____instead of the current node itself, which can skip the last node.
Hint
Think about prematurely checking the next node before processing it.
Answer
current.next
- 11In a recursive traversal, the base case occurs when the head (or current node) is_____.
Hint
This represents an empty list or the end of the list.
Answer
null
- 12In the linked list values problem, we return an_____containing all node values in order.
Hint
Think of a collection type that holds multiple values in a sequence.
Answer
array
- 13In the iterative solution for linked list values, we push each node's value into the array and then set current =_____.
Hint
This progresses the traversal to the next node.
Answer
current.next
- 14In the recursive solution for linked list values, we use a helper function that takes the head and a reference to the values_____to avoid creating multiple arrays.
Hint
By passing the same array reference, all recursive calls add to the same collection.
Answer
array
- 15In the sum list problem, the iterative solution initializes a sum variable to_____.
Hint
What is the identity element for addition?
Answer
0
- 16In the recursive sum list solution, the base case when head is null returns_____.
Hint
An empty linked list has a total sum of what?
Answer
0
- 17In the linked list find problem, the iterative solution returns_____early when a match is found.
Hint
What boolean indicates the target is present?
Answer
true
- 18In the recursive find solution, one base case returns true when_____equals the target.
Hint
Check the current node's data against the target.
Answer
head.val
- 19In the get node value problem, the iterative solution counts_____to track the index of the current node.
Hint
Count starts at 0 and increases with each node.
Answer
upward
- 20In the recursive get node value solution, we pass_____as the index to the recursive call to approach the target.
Hint
We reduce the index each recursion to eventually reach zero.
Answer
index - 1
- 21If the target index is out of range in get node value, the iterative solution returns_____after the loop.
Hint
What value represents 'not found' for a node?
Answer
null
- 22In the reverse list problem, we need to reverse the_____pointers of the linked list in place.
Hint
Which pointer determines the order of nodes?
Answer
next
- 23In the iterative reverse solution, we use a variable called_____that is initially null to track the previous node.
Hint
It holds the node that was before the current node before reversal.
Answer
previous
- 24In the recursive reverse solution, the base case returns_____when head is null.
Hint
After reaching the end, which variable holds the new head?
Answer
previous
- 25In the zipper list problem, we always start with the first node of_____.
Hint
Which input list provides the first node of the merged list?
Answer
list one
- 26In the iterative zipper solution, we use a_____pointer to build the output list by appending nodes.
Hint
This pointer always points to the last node of the merged list so far.
Answer
tail
- 27In the iterative zipper, we use a counter to decide which list to take from; when the counter is even, we take from_____.
Hint
Because we started with list one, the first 'next' should come from the other list.
Answer
list two
- 28When one list runs out during zipper, we append the remaining nodes of the other list by setting_____to the remaining current pointer.
Hint
We attach the whole leftover chain to the end of the merged list.
Answer
tail.next

Ask anything
We've read this whole study set, so questions about it get the best answers.