This quiz contains multiple-choice problems on the types and complexity of algorithms, integers and their division
An algorithm is a/an __ set of precise instructions for performing computation.
Infinite
Finite
Constant
None of the above
Which of the following property algorithms does not share?
Input
Finiteness
Generality
Constancy
In a __ search, each element is compared with x till not found.
Binary
Sequential
Merge
None of the above
If the entire list is searched sequentially without locating x in linear search, the solution is
0
-1
1
2
The insertion sort begins with the __ element to sort a list with n elements.
First
Second
Third
Fourth
The worst-case scenario in a linear search algorithm occurs when the
The item is somewhere in the middle of the array
The item is not in the array at all
The item is the last element in the array
The item is the last element or not at all in the array
__ is the list obtained in the third pass of selection sort for the list 3, 5, 4, 1, 2.
1, 2, 4, 3, 5
1, 2, 3, 4, 5
1, 5, 4, 3, 2
3, 5, 4, 1, 2
The operation of processing each element in the list is known as
Sorting
Merging
Inserting
Traversal
The complexity of the bubble sort algorithm is
O(n)
O(log n)
O(n2)
O(n log n)
What is an algorithm?
A procedure for solving a problem
A problem
A real-life mathematical problem
None of the above
An algorithm that uses the past results and uses them to find the new results is called
Brute force
Divide-and-conquer
Dynamic programming algorithms
None of the above
The complexity of an algorithm depends upon
Time only
Space only
Both time and space
None of the above
An algorithm that tries all possibilities, unless results are not satisfactory and generally time-consuming, is called
Brute force
Divide-and-conquer
Dynamic programming algorithms
None of the above
__ comparisons required to sort the list 1, 2, 3…….n using insertion sort.
(n^2 + n + 2)/2
(n^3 + n – 2)/2
(n^2 + n – 2)/2
(n^2 – n – 2)/2
An algorithm in which we divide the problem into subproblems and then combine the subsolutions to form a solution to the original problem is known as
Brute force
Divide-and-conquer
Greedy algorithm
None of the above