AQA A Level · Computer Science 7517

圖:練習題

5 條多項選擇題即時批改,另有 5 條文字題附完整解題步驟,全部圍繞「圖」。

10 條題目27 免費,無需登記
第 1 題
1

In the context of graph theory, what is the defining characteristic of a weighted graph?

第 2 題
1

Which graph traversal algorithm uses a stack (either explicitly or via recursion) to explore as far as possible along each branch before backtracking?

第 3 題
1

In an algorithm designed to navigate a maze, why is Depth-First Search (DFS) often preferred over Breadth-First Search (BFS) if the goal is simply to find any path to the exit rather than the shortest one?

第 4 題
1

A directed graph has 5 vertices. What is the maximum number of edges this graph can have, assuming no more than one edge exists between any two vertices in the same direction and there are no self-loops?

第 5 題
1

When comparing an adjacency matrix to an adjacency list for representing a directed graph with \( V \) vertices and \( E \) edges, what is the time complexity required to determine if a specific edge exists between vertex \( i \) and vertex \( j \) in the matrix representation?

第 6 題
3

An adjacency matrix is used to represent an undirected graph with 5 vertices. How many cells in the matrix must be updated if a single new edge is added between two existing vertices?

先自己寫一次答案,再對照解題步驟。

第 7 題
5

A directed graph is represented using an adjacency matrix. If there are \( n \) vertices and the matrix is sparse, what is the space complexity of this representation, and why might an adjacency list be preferred for such a graph?

先自己寫一次答案,再對照解題步驟。

第 8 題
4

A programmer needs to decide between an Adjacency Matrix and an Adjacency List for a graph with 5,000 vertices and only 6,000 edges. Identify which structure is more memory-efficient and justify why.

先自己寫一次答案,再對照解題步驟。

第 9 題
5

An unweighted graph is represented using an adjacency matrix.

(a) Define what an adjacency matrix is and how it represents edges between vertices.
(b) State one advantage of using an adjacency list over an adjacency matrix for a sparse graph.
(c) If an undirected graph has 4 vertices (A, B, C, D) and edges (A,B), (B,C), (C,D), draw the corresponding adjacency matrix (assume 1 for edge, 0 for no edge).

先自己寫一次答案,再對照解題步驟。

第 10 題
5

A programmer is choosing between an adjacency matrix and an adjacency list for a graph representation.

(a) Define a weighted graph and explain how weights are stored in an adjacency matrix compared to an adjacency list.

(b) For a sparse graph with \( V \) vertices and \( E \) edges, justify which representation is more memory-efficient using Big-O notation for space complexity.

(c) State the time complexity for checking if an edge exists between two specific nodes in both representations.

先自己寫一次答案,再對照解題步驟。

* thinka提供的內容由AI生成,可能並非總是準確或最新。請將其用作輔助資源,並與官方材料進行核實。

你已看過標準答案,接下來輪到批改你的答案。

這一頁可以告訴你好答案的樣子,卻無法指出你的答案欠缺什麼。thinka 按真實評分準則批改你的文字答案,約 15 秒完成。

想多做幾條同類題目?立即開始練習呢個課題,即做即批改。

立即練習