DescriptionQ1018
Q1018FWASIC interview problem
Merge two sorted linked lists
TechniquesLinked listMerge
DifficultyEasy
TopicLinked Lists
LanguageSystemVerilog
Requirements3 checkpoints
01
Problem
Merge two linked lists sorted by node value and return one sorted list.
Example input and output
Use this case to check your interpretationInput
a = 1 -> 3 -> 5, b = 1 -> 2 -> 6Output
1 -> 1 -> 2 -> 3 -> 5 -> 6Explanation
Taking from a when equal preserves stable ordering while reusing every input node.
02
Requirements (3)
- Reuse the existing nodes.
- Keep the merge stable when values are equal.
- Append the remaining tail after one input is exhausted.
