MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

ALGORITHMS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Select the true statements:
A
If two different algorithms are correct for the same problem, then the efficiencies must be the same.
B
Sometimes, more efficient algorithms are more complex.
C
Finding an efficient algorithm for a problem can help solve larger instances of the problem.
D
None of the above
Explanation: 

Detailed explanation-1: -Counting the operations. One way to measure the efficiency of an algorithm is to count how many operations it needs in order to find the answer across different input sizes.

Detailed explanation-2: -Completeness: A search algorithm is said to be complete if it guarantees to return a solution if at least any solution exists for any random input.

Detailed explanation-3: -Quicksort. Quicksort is one of the most efficient sorting algorithms, and this makes of it one of the most used as well. The first thing to do is to select a pivot number, this number will separate the data, on its left are the numbers smaller than it and the greater numbers on the right.

Detailed explanation-4: -The efficiency of an algorithm is mainly defined by two factors i.e. space and time. A good algorithm is one that is taking less time and less space, but this is not possible all the time. There is a trade-off between time and space. If you want to reduce the time, then space might increase.

There is 1 question to complete.