Recall & Review
beginner
What is a LinkedList in C#?
A LinkedList is a collection that stores elements in nodes, where each node points to the next and previous nodes, allowing efficient insertions and deletions anywhere in the list.
Click to reveal answer
beginner
How do you add an element at the start of a LinkedList in C#?
Use the AddFirst() method. For example: linkedList.AddFirst(value); adds a new node with the given value at the beginning.
Click to reveal answer
beginner
What method removes the last element from a LinkedList in C#?
The RemoveLast() method removes the last node from the LinkedList.
Click to reveal answer
beginner
How can you find a specific value in a LinkedList?
Use the Find(value) method. It returns the first node containing the value or null if not found.
Click to reveal answer
intermediate
Why might you choose a LinkedList over a List in C#?
LinkedList allows faster insertions and deletions in the middle of the list because it doesn't require shifting elements like a List does.
Click to reveal answer
Which method adds a new node at the end of a LinkedList in C#?
✗ Incorrect
AddLast() adds a new node at the end of the LinkedList.
What does the Find(value) method return if the value is not found in the LinkedList?
✗ Incorrect
Find(value) returns null if the value is not found.
Which of these is NOT a benefit of using LinkedList over List?
✗ Incorrect
LinkedList does not support fast random access by index; List is better for that.
How do you remove the first node from a LinkedList in C#?
✗ Incorrect
RemoveFirst() removes the first node from the LinkedList.
What type of data structure is a LinkedList?
✗ Incorrect
LinkedList is a node-based data structure where each node links to others.
Explain how to add and remove elements in a LinkedList in C#.
Think about methods that add or remove nodes at the start or end.
You got /5 concepts.
Describe when and why you would use a LinkedList instead of a List in C#.
Consider performance differences for different operations.
You got /4 concepts.