Embercode
✕
Linked ListsQuick quiz

Intersection in Python

6 questions. Covers Intersection of two lists in Python.

Questions 1 to 5 of 6

  1. 1. Lists C and D are built separately with build(1, 2) each. Both hold 1 -> 2, so their values match, but no node is shared. What do length_difference(c, d) and two_pointers(c, d) return?
  2. 2. Which statements about the two methods in this lesson are true? Pick all that apply.

    Pick every answer that is true.

  3. 3. Using build, join, length_difference and two_pointers from this lesson, what does this code print? ``python shared = build(9, 3) a = join(build(1), shared) b = join(build(2, 4, 5), shared) print("first", length_difference(a, b).val, "second", two_pointers(a, b).val) ``
  4. 4. True or false, with a reason: two nodes that both hold the value 8, one in list A and one in list B, count as a shared node because their values match.
  5. 5. Which expression asks whether two references a and b point at the same node object?

5 question(s) left on this page.