Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 5 MCQs More on Dynamic Programming

ECAP538 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 All-pairs shortest paths Easy

    What does the all-pairs shortest paths problem compute?

  2. Question 2 of 60 All-pairs shortest paths Easy

    Which dynamic programming algorithm commonly solves the all-pairs shortest paths problem?

  3. Question 3 of 60 All-pairs shortest paths Easy

    What is the time complexity of the Floyd-Warshall algorithm for vertices?

  4. Question 4 of 60 All-pairs shortest paths Easy

    What is normally stored in entry of the final Floyd-Warshall matrix?

  5. Question 5 of 60 All-pairs shortest paths Easy

    What is the usual initial distance from a vertex to itself?

  6. Question 6 of 60 All-pairs shortest paths Easy

    How is the initial distance from to usually represented when no direct edge exists?

  7. Question 7 of 60 All-pairs shortest paths Easy

    Which update rule is used by the Floyd-Warshall algorithm when considering vertex ?

  8. Question 8 of 60 All-pairs shortest paths Easy

    Can the Floyd-Warshall algorithm process graphs containing negative edge weights?

  9. Question 9 of 60 All-pairs shortest paths Easy

    After Floyd-Warshall finishes, what indicates a negative cycle?

  10. Question 10 of 60 All-pairs shortest paths Easy

    Which graph representation is most directly used by the Floyd-Warshall algorithm?

  11. Question 11 of 60 Optimal binary search trees Easy

    What is the main objective of an optimal binary search tree?

  12. Question 12 of 60 Optimal binary search trees Easy

    What information is primarily used to construct an optimal binary search tree?

  13. Question 13 of 60 Optimal binary search trees Easy

    Where are frequently searched keys generally placed in an optimal binary search tree?

  14. Question 14 of 60 Optimal binary search trees Easy

    Which traversal of a binary search tree lists its keys in sorted order?

  15. Question 15 of 60 Optimal binary search trees Easy

    What does the dynamic programming solution test for each key interval?

  16. Question 16 of 60 Optimal binary search trees Easy

    What property must an optimal binary search tree preserve?

  17. Question 17 of 60 Optimal binary search trees Easy

    What do dummy keys represent in the standard optimal binary search tree model?

  18. Question 18 of 60 Optimal binary search trees Easy

    Which technique avoids repeatedly solving the same optimal-BST subproblems?

  19. Question 19 of 60 Optimal binary search trees Easy

    If all keys have equal search probability, which tree shape generally gives a low search cost?

  20. Question 20 of 60 Optimal binary search trees Easy

    What is the usual time complexity of the basic dynamic programming algorithm for an optimal BST with keys?

  21. Question 21 of 60 All-pairs shortest paths Medium

    During Floyd–Warshall processing, suppose , , and . What is the updated value of after considering vertex ?

  22. Question 22 of 60 All-pairs shortest paths Medium

    A directed graph has edges , , , , and . What is the shortest-path distance from to ?

  23. Question 23 of 60 All-pairs shortest paths Medium

    After Floyd–Warshall finishes, which result indicates that a vertex belongs to or can participate in a reachable negative-weight cycle?

  24. Question 24 of 60 All-pairs shortest paths Medium

    What are the standard time and space complexities of Floyd–Warshall when its distance table is stored as a matrix?

  25. Question 25 of 60 All-pairs shortest paths Medium

    In the Floyd–Warshall recurrence, represents the shortest path from to whose intermediate vertices are restricted to which set?

  26. Question 26 of 60 All-pairs shortest paths Medium

    For a sparse directed graph with nonnegative edge weights, which approach usually computes all-pairs shortest paths more efficiently than Floyd–Warshall?

  27. Question 27 of 60 All-pairs shortest paths Medium

    A Floyd–Warshall implementation maintains a next-hop matrix. If an update through improves the path from to , how should the next hop for be updated?

  28. Question 28 of 60 All-pairs shortest paths Medium

    Using min-plus matrix multiplication, let row of be and column of be . What is the resulting entry ?

  29. Question 29 of 60 All-pairs shortest paths Medium

    Suppose all-pairs distances are already known and a new directed edge of weight is added without creating a negative cycle. Which expression correctly tests a path from to that uses the new edge?

  30. Question 30 of 60 All-pairs shortest paths Medium

    Johnson's algorithm assigns each edge the reweighted cost . Why does this preserve shortest paths between each source and destination?

  31. Question 31 of 60 Optimal binary search trees Medium

    Two ordered keys have successful-search probabilities and . If only successful searches are considered, which root minimizes the expected number of comparisons?

  32. Question 32 of 60 Optimal binary search trees Medium

    For ordered keys with successful-search frequencies , , and , respectively, which key should be the root of an optimal BST?

  33. Question 33 of 60 Optimal binary search trees Medium

    When only successful-search frequencies are used, which recurrence correctly defines the optimal weighted search cost ?

  34. Question 34 of 60 Optimal binary search trees Medium

    In what order should interval entries generally be computed in the dynamic programming table for an optimal BST?

  35. Question 35 of 60 Optimal binary search trees Medium

    An optimal-BST algorithm stores the selected root index in . After choosing , which intervals must be recursively reconstructed?

  36. Question 36 of 60 Optimal binary search trees Medium

    In an optimal BST that includes unsuccessful-search probabilities, what does conventionally represent?

  37. Question 37 of 60 Optimal binary search trees Medium

    For ordered keys with successful-search frequencies , which root yields the minimum weighted search cost?

  38. Question 38 of 60 Optimal binary search trees Medium

    If every successful- and unsuccessful-search probability is multiplied by the same positive constant, how does the optimal BST change?

  39. Question 39 of 60 Optimal binary search trees Medium

    For four ordered keys with successful-search frequencies , why can choosing the most frequent key as the root be suboptimal?

  40. Question 40 of 60 Optimal binary search trees Medium

    An optimal BST has one key with successful-search probability and unsuccessful-search probabilities and . Counting the root at depth and dummy leaves at depth , what is the expected search cost?

  41. Question 41 of 60 All-pairs shortest paths Hard

    In Floyd–Warshall, let denote the value after completing iteration . Which invariant precisely supports the recurrence ?

  42. Question 42 of 60 All-pairs shortest paths Hard

    After Floyd–Warshall finishes, suppose . For which ordered pairs is the shortest-path value unbounded below because of this negative cycle?

  43. Question 43 of 60 All-pairs shortest paths Hard

    Let be the weighted adjacency matrix, with and unreachable entries equal to . Under min-plus multiplication, what does the entry of represent?

  44. Question 44 of 60 All-pairs shortest paths Hard

    Johnson's algorithm computes potentials and defines . If Dijkstra returns in the reweighted graph, which expression recovers the original distance?

  45. Question 45 of 60 All-pairs shortest paths Hard

    During Johnson's algorithm, Bellman–Ford finds an edge that can still be relaxed after passes from the added super-source. What is the correct conclusion?

  46. Question 46 of 60 All-pairs shortest paths Hard

    Assuming no negative cycles, which loop-order constraint is essential for a correct in-place implementation of Floyd–Warshall?

  47. Question 47 of 60 All-pairs shortest paths Hard

    A graph with known APSP distances receives a new directed edge of weight . Assume the old graph and the updated graph have no negative cycles. Which formula gives every updated distance?

  48. Question 48 of 60 All-pairs shortest paths Hard

    To compute transitive closure with the Floyd–Warshall structure, which semiring-style replacement is required?

  49. Question 49 of 60 All-pairs shortest paths Hard

    Using Fibonacci heaps, what is the asymptotic running time of Johnson's algorithm on a graph with vertices and edges?

  50. Question 50 of 60 All-pairs shortest paths Hard

    A Floyd–Warshall implementation stores , the first vertex after on a reconstructed shortest path to . If iteration strictly improves through , how should this entry be updated?

  51. Question 51 of 60 Optimal binary search trees Hard

    For successful probabilities , unsuccessful probabilities , base cases , and interval mass , which is the correct optimal-BST recurrence?

  52. Question 52 of 60 Optimal binary search trees Hard

    For two keys, let , , , , and . Using the standard optimal-BST recurrence, which root and expected cost are optimal?

  53. Question 53 of 60 Optimal binary search trees Hard

    An optimal BST has only successful-search probabilities and charges one comparison at the root. Which root and expected comparison count are optimal?

  54. Question 54 of 60 Optimal binary search trees Hard

    Let store an optimal root for interval . Under the standard assumptions enabling Knuth optimization, which range is sufficient when searching for ?

  55. Question 55 of 60 Optimal binary search trees Hard

    What time and space bounds result when the standard optimal-BST dynamic program uses Knuth's root-monotonicity optimization while retaining its cost and root tables?

  56. Question 56 of 60 Optimal binary search trees Hard

    Define and , with empty prefixes equal to zero. Which expression computes the interval mass in constant time?

  57. Question 57 of 60 Optimal binary search trees Hard

    Why does the term appear once in every candidate of the optimal-BST recurrence, independently of the chosen root?

  58. Question 58 of 60 Optimal binary search trees Hard

    All successful and unsuccessful search weights in an optimal-BST instance are multiplied by the same constant . What necessarily happens?

  59. Question 59 of 60 Optimal binary search trees Hard

    For interval , suppose . The relevant left/right cost pairs for roots are respectively , , , and . Which candidate is optimal?

  60. Question 60 of 60 Optimal binary search trees Hard

    An optimal-root table gives , , , , and . What is the preorder traversal of the reconstructed key tree?

That's unit 5

Answer a few questions and your score shows up here.