Embercode
✕
Linked ListsQuick quiz

Copying with random pointers in Python

6 questions. Covers Copy a list with random pointers in Python.

Questions 1 to 5 of 6

  1. 1. In the five-node example 7[null] -> 13[7] -> 11[1] -> 10[11] -> 1[7], a single pass copies each node and sets its random pointer in the same step, using copies.get(cur.random). Why does the copy of node 11 end up with random set to None?
  2. 2. Which statements about copy_with_map and is_deep_copy are true?

    Pick every answer that is true.

  3. 3. Match each term from the lesson to its meaning.

    Choose the matching item for each row.

  4. 4. Which statements about step 3 of copy_interleaved are true?

    Pick every answer that is true.

  5. 5. Match each mistake from the Common mistakes section to the symptom it causes.

    Choose the matching item for each row.

5 question(s) left on this page.