Recall & Review
beginner
What is a singly linked list?
A singly linked list is a chain of nodes where each node holds data and a link to the next node. It starts at a head node and ends when a node points to null (no next node).
Click to reveal answer
beginner
What are the two main parts of a node in a singly linked list?
Each node has two parts: <br>1. Data: stores the value or information.<br>2. Next: a reference (link) to the next node in the list or null if it is the last node.
Click to reveal answer
intermediate
How do you add a new node at the end of a singly linked list?
To add a node at the end:<br>1. Create the new node.<br>2. Start from the head and move through nodes until you find the last node (next is null).<br>3. Set the last node's next to the new node.<br>4. The new node's next is null.
Click to reveal answer
beginner
Why do singly linked lists not allow backward traversal?
Because each node only has a link to the next node, there is no reference to the previous node. So, you can only move forward from the head to the end.
Click to reveal answer
intermediate
What is the time complexity to find the last node in a singly linked list?
It is O(n), where n is the number of nodes, because you must check each node from the head until you reach the last node.
Click to reveal answer
What does the 'next' part of a node in a singly linked list store?
✗ Incorrect
The 'next' part stores the reference (link) to the next node in the list.
What is the first node in a singly linked list called?
✗ Incorrect
The first node is called the head.
If a singly linked list has 5 nodes, how many steps to reach the last node from the head?
✗ Incorrect
You must move through 4 links to reach the 5th node starting from the head.
Which operation is easiest in a singly linked list?
✗ Incorrect
If you keep a tail pointer, inserting at the end is easy and fast.
What happens if you try to access the next node of the last node?
✗ Incorrect
The last node's next is null, meaning no next node exists.
Explain how to create a singly linked list from scratch and add nodes to it.
Think about how each node connects to the next and how you find the end.
You got /4 concepts.
Describe the difference between singly linked list and arrays in terms of structure and traversal.
Focus on how elements are stored and accessed.
You got /4 concepts.