MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

ALGORITHMS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
For which of the following situations would it be best to use a heuristic in order to find a solution that runs in a reasonable amount of time?
A
Appending a value to a list of n elements, which requires no list elements be examined.
B
Finding the fastest route that visits every location among n locations, which requires n! possible routes be examined.
C
Performing a binary search for a score in a sorted list of n scores, which requires that fewer than n scores be examined.
D
Performing a linear search for a name in an unsorted database of n people, which requires that up to n entries be examined.
Explanation: 

Detailed explanation-1: -For which of the following situations would it be best to use a heuristic in order to find a solution that runs in a reasonable amount of time? Appending a value to a list of n elements, which requires no list elements be examined.

Detailed explanation-2: -Which of the following best describes the ability of parallel computing solutions to improve efficiency? Any problem that can be solved sequentially can be solved using a parallel solution in approximately half the time.

Detailed explanation-3: -Choice ā€˜Cā€™ is the correct answer. The definition of a heuristic is a technique that allows the user to find an approximate answer in a reasonable amount of time. We use heuristic algorithms when problems cannot be solved in a reasonable time and they do not have an exact answer.

Detailed explanation-4: -Which of the following best explains how algorithms that run on a computer can be used to solve problems? All problems can be solved with an algorithm that runs in a reasonable amount of time. All problems can be solved with an algorithm, but some algorithms might need a heuristic to run in a reasonable amount of time.

Detailed explanation-5: -Using algorithms rather than heuristics can sometimes be the better way to solve problems, however, it does not have to be the best way in every situation.

There is 1 question to complete.