Which optimized pattern solves this lesson cleanly?

Practice this question from Clone Graph - Hash Map DFS Pattern Practice Quiz, with options and an explanation.

Question

Which optimized pattern solves this lesson cleanly?

Option A — Correct answer

Use a hash map from original node to cloned node during DFS.

Option B

Nested loops without visited state

Option C

Two pointers on a sorted array

Option D

Character frequency counting only

Explanation

Use a hash map from original node to cloned node during DFS.

Clone Graph - Hash Map DFS Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker