AQA A Level · Computer Science 7517

圖的遍歷:练习题

5 道选择题即时批改,另有 5 道文字题附完整解题步骤,全部围绕「圖的遍歷」。

10 道题目25 免费,无需注册
第 1 题
1

In the context of graph-traversal, which algorithm is best suited for finding the shortest path between two nodes in an unweighted graph?

第 2 题
1

In an unweighted graph, a student needs to find the shortest path between two nodes. Which graph-traversal algorithm should they use, and which primary data structure is used to manage the nodes that are discovered but not yet visited to ensure this shortest path property is maintained?

第 3 题
1

Consider a directed graph where a Depth-First Search (DFS) is implemented. During the traversal, an edge is encountered that points from the current node to an ancestor currently in the recursion stack. What property of the graph does this specific edge identify?

第 4 题
1

In the context of graph-traversal, which algorithm is typically used to find the shortest path between two nodes in an unweighted graph?

第 5 题
1

A developer is using graph-traversal to solve a puzzle. The search space is modeled as a tree where the target node is known to be very close to the root, but the tree itself is infinitely deep. Which algorithm is guaranteed to find the target, and why?

第 6 题
2

In an undirected, unweighted graph, which specific traversal algorithm is most suitable for finding the shortest path between two given vertices?

先自己写一遍答案,再对照解题步骤。

第 7 题
3

A depth-first search (DFS) is applied to a graph. Describe a specific real-world scenario mentioned in the syllabus where this traversal method is commonly used.

先自己写一遍答案,再对照解题步骤。

第 8 题
5

During a Breadth-first search on an unweighted graph, a queue is used to manage vertices. Explain the relationship between the distance from the start node and the order in which vertices are added to this queue.

先自己写一遍答案,再对照解题步骤。

第 9 题
4

A graph contains 5 nodes (A, B, C, D, E) and the following undirected edges: (A,B), (A,C), (B,D), (C,E).

(a) Trace a Breadth-First Search (BFS) starting at node A. Assume nodes are visited in alphabetical order where a choice exists.
(b) Identify a typical application for a Breadth-First Search in an unweighted graph.

先自己写一遍答案,再对照解题步骤。

第 10 题
6

A Depth-First Search (DFS) and Breadth-First Search (BFS) are used to explore a graph representing a set of connected islands.

(a) Describe the specific application for BFS in an unweighted graph and why it is more suitable than DFS for this purpose.

(b) Explain the role of stack frames in a recursive implementation of DFS.

(c) Compare the space complexity of BFS and DFS when traversing a graph that is very 'wide' (high branching factor) but has a shallow depth.

先自己写一遍答案,再对照解题步骤。

* thinka 提供的内容由 AI 生成,未必在任何情况下都完全准确或最新,请结合官方教材与教师指导使用。

你已看过标准答案。现在轮到你的答案被批改。

这一页能告诉你好答案是什么样子,却无法指出你的答案缺了什么。thinka 按真实评分标准批改你的文字答案,约 15 秒完成。

想多做几道同类题目?立即开始练习这个课题,边做边批改。

立即练习