AQA A Level · Computer Science 7517

Graphs:練習問題

その場で採点される選択問題 5 問と、解説つきの記述問題 5 問。すべて「Graphs」からの出題です。

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 秒で採点します。

同じような問題をもっと解きたい?このトピックの新しい問題を、解きながら採点。

練習を始める