Question Bank

Linked List Basics Quiz

Difficulty: Easy

Short prompts on singly vs doubly linked lists, traversal, length, and the everyday operations that come up before cycle detection or in-place reversal.

Question Bank
/

Linked List Basics Quiz

Linked List Basics Quiz

Short prompts on singly vs doubly linked lists, traversal, length, and the everyday operations that come up before cycle detection or in-place reversal.

Question Bank
Easy
JavaScript
4 questions
linked-list
data-structures
quiz
fundamentals

874 views

13

What does this code print? Trace each step.

Examples

Example 1:

Input: head -> 1 -> 2 -> 3 -> null
Output: 1 2 3
Explanation: Walker cur starts at head, appends cur.value to out, then advances via cur.next until cur is null. The final trimmed string is '1 2 3'.