試験Foundations-of-Computer-Science トピック1 問題47 スレッド
WGU Foundations-of-Computer-Scienceのリアル試験問題集
問題 #: 47
トピック #: 1
問題 #: 47
トピック #: 1
Which type of data structure is the only focus of a binary search?
おすすめの解答:A 解答を投票する
Binary search is designed for searching in asorted (ordered) sequence. Its efficiency comes from repeatedly comparing the target to the middle element and discarding half of the remaining search space. This halving logic only works when the data is ordered, because the algorithm relies on the guarantee that all elements on one side of the midpoint are smaller (or larger) than the midpoint. In textbooks, this requirement is stated explicitly: binary search assumes the collection is sorted according to the same ordering used for comparisons.
An "ordered list" is therefore the correct focus among the options. Binary search can be implemented on arrays or other random-access structures where you can quickly access the middle element by index. While you can conceptually perform binary search on a linked list, it becomes inefficient because finding the middle requires linear traversal, losing the O(log n) advantage. Stacks and queues are not appropriate because they restrict access to ends only (LIFO for stacks, FIFO for queues), preventing direct access to the midpoint and making the binary search strategy infeasible.
Thus, the central requirement for binary search is a sorted/ordered sequence, typically supporting efficient indexing, which is why the correct choice is an ordered list.
An "ordered list" is therefore the correct focus among the options. Binary search can be implemented on arrays or other random-access structures where you can quickly access the middle element by index. While you can conceptually perform binary search on a linked list, it becomes inefficient because finding the middle requires linear traversal, losing the O(log n) advantage. Stacks and queues are not appropriate because they restrict access to ends only (LIFO for stacks, FIFO for queues), preventing direct access to the midpoint and making the binary search strategy infeasible.
Thus, the central requirement for binary search is a sorted/ordered sequence, typically supporting efficient indexing, which is why the correct choice is an ordered list.
Yoshimoto 2026-05-05 10:23:39
コメント
他人の解答コメントを賛成するのも、その解答に一票を入れることになります。したがって、すでに同じ意見の投票コメントが存在する場合、新規コメントをする代わりに賛成することもできます。
コメントを通報する
コメント中
今すぐ 新規登録 / ログイン (無料です)。