← 回題庫

卷別

資料結構及演算法

選擇

國立政治大學 2025 · 考試 · 第 11 題

考科演算法

(4%) Which of the following statements concerning topological ordering is true?

  • (A)
    It is impossible to give the topological ordering for a direct cyclic graph.
  • (B)
    The shortest paths from a single source in a weighted DAG can be found using an O(V+E)O(V+E)-time greedy algorithm based on topological ordering, where VV is the number of vertices and EE is the number of edges.
  • (C)
    In a DAG, if there is a path from vertex uu to vertex vv, then vv appears after uu in topological ordering.
  • (D)
    The longest paths from a single source in a weighted DAG can be found using an O(V+E)O(V+E)-time greedy algorithm based on topological ordering, where VV is the number of vertices and EE is the number of edges.
  • (E)
    All of the above.

標準解析

AI 已複查