题目
单项选择题
Match the computational problem with the most appropriate algorithm that can be used to solve it. Do two student essays share a common phrase consisting of a sequence of more than 100 letters? Given the airports at which an airline operates and the distances between those airports, what is the shortest total flight distance between two airports? Given a sorted array of a company's employee records and an employee's first and last name, what is a specific employee's phone number?
选项
A.A)1 - Binary Search2 - Shortest Path Algorithm3 - Longest Common Substring
B.B)1 - Longest Common Substring2 - Shortest Path Algorithm3 - Binary Search
C.C)1 - Shortest Path Algorithm2 - Longest Common Substring3 - Binary Search
D.D)1 - Longest Common Substring2 - Binary Search3 - Shortest Path Algorithm
查看解析
标准答案
Please login to view
思路分析
To tackle this question, I’ll map each described problem to the most appropriate algorithm technique and then evaluate which option aligns with all three mappings.
Option A: "1 - Binary Search, 2 - Shortest Path Algorithm, 3 - Longest Common Substring". For problem 1, binary search is unsuitable for finding a shared phrase between two large texts, since binary search is used on sorted data or to locate a target within a sorted structure, not to compare arbitrary substrings. So this mislabels the first problem. For problem 2, while a shortest path problem could be solved by a shortest path algorithm, option A a......Login to view full explanation登录即可查看完整答案
我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。
类似问题
A sequence of steps that is unambiguous, executable, and terminating is called:
Imagine that you are planning to buy a new cell phone. After doing some research, you have determined that there are two different cell phones that will meet your needs. These cell phones have different purchase prices and each mobile service provider charges a different rate for each minute that the cell phone is used. In order to determine which cell phone is the better buy, you need to develop an algorithm to calculate the total cost of purchasing and using each cell phone. Which of the following options lists all the inputs needed for this algorithm?
What is a key aspect of implementing algorithms in programming?
I absolutely loved comp10002 Foundations of Algorithms, and will recommend it to all my friends, because of:
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!