Embercode
✕
GraphsQuick quiz

MST edges and word ladder

8 questions. Covers Word ladder with BFS and wildcard buckets in Python.

Questions 1 to 5 of 8

  1. 1. Using the find_critical_and_pseudo_critical function from this lesson, what does this call print? ``python print(find_critical_and_pseudo_critical(4, [[0, 1, 2], [1, 2, 3], [2, 3, 2], [0, 3, 4]])) ``
  2. 2. In the 5 vertex, 7 edge example from this lesson, removing edge 4 (0 to 4, weight 3) leaves the total at 7, and forcing edge 4 in also gives 7. Which group is edge 4 in?
  3. 3. Put these steps of one mst_weight call in the order the code runs them.

    Use the arrows to put the steps in order.

    1. 1.Walk the sorted edge order, skip the skipped and forced edges, and add each edge that joins two groups
    2. 2.Return the total if n - 1 edges were taken, otherwise return -1
    3. 3.If a forced edge is given, join its two ends and add its weight to the total
    4. 4.Make the parent list so that every vertex is its own root
  4. 4. What is the name of the function in this lesson's critical-edges program that runs one Kruskal pass with an optional skipped edge and an optional forced edge?

    Type your answer.

  5. 5. What does this call print? ``python print(ladder_length("aa", "cc", ["ab", "bb", "bc", "cc"])) ` Use the ladder_length` function from this lesson.

4 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.