AQA A Level · Computer Science 7517

Tree-traversal:練習問題

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

10 問24 無料・登録不要
問 1
1

Which tree-traversal algorithm would be most appropriate to use if you wanted to create a complete copy of a binary tree structure?

問 2
1

Which of the following describes the correct sequence of operations for a pre-order traversal of a rooted binary tree?

問 3
1

A binary tree is traversed and produces the following outputs:
Pre-order: F, B, A, D, C, E, G, I, H
In-order: A, B, C, D, E, F, G, H, I

What is the post-order traversal of this tree?

問 4
1

When performing an in-order traversal on a binary search tree (BST) containing numeric values, in what order will the contents be processed?

問 5
1

Which of the following describes a scenario where post-order traversal is essential for the correct operation of an algorithm?

問 6
2

What is one specific practical application of performing a Pre-order traversal on a rooted tree structure?

まず自分で答えを書いてから、解説と照らし合わせましょう。

問 7
3

When performing an In-order traversal on a Binary Search Tree (BST) containing integer values, what is the characteristic property of the resulting output sequence?

まず自分で答えを書いてから、解説と照らし合わせましょう。

問 8
5

A binary tree is used to represent a file directory system. Which traversal method would be used to delete a directory only after all of its sub-directories and files have been deleted?

まず自分で答えを書いてから、解説と照らし合わせましょう。

問 9
4

A rooted tree is used to represent an arithmetic expression: \( (8 - 3) \times (4 + 2) \).

(a) Describe how an In-order traversal of this expression tree would look, including the placement of brackets.
(b) Perform a Post-order traversal on the tree and state the resulting sequence.
(c) Explain the relationship between the result of a post-order traversal and Reverse Polish Notation (RPN).

まず自分で答えを書いてから、解説と照らし合わせましょう。

問 10
5

Consider a binary search tree (BST) where nodes are traversed using different methods.

(a) List the steps for an In-order traversal.
(b) Explain why an In-order traversal is particularly useful for a BST compared to other trees.
(c) Describe a practical use for Pre-order traversal.

まず自分で答えを書いてから、解説と照らし合わせましょう。

※ thinkaのコンテンツはAIにより生成されているため、内容が正確でない場合があります。補助教材としてご使用いただき、公式の教材と合わせてご確認ください。

模範解答は見ました。次はあなたの答案を採点します。

このページは良い答案の形を示せますが、あなたの答案に何が足りないかは教えられません。thinka は実際の採点基準に沿って記述答案を約 15 秒で採点します。

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

練習を始める