Algorithms

Question 1
Marks : +2 | -2
Pass Ratio : 100%
The complexity of Binary search algorithm is _________
O(n)
O(log)
O(n2)
O(n log n)
Explanation:
The compexity of binary search is O(logn).
Question 2
Marks : +2 | -2
Pass Ratio : 100%
If the entire list is searched sequentially without locating x in linear search, the solution is __________
0
-1
1
2
Explanation:
If the element is not found in the entire list, then the solution is 0.
Question 3
Marks : +2 | -2
Pass Ratio : 100%
The value of 15 mod 11 is?
1
2
3
4
Explanation:
By the Division algorithm 15 = 11(1) + 4. Where the remainder is 15 mod 11.
Question 4
Marks : +2 | -2
Pass Ratio : 100%
The quotient and remainder when -1 is divided by 3 is?
-1 and -1
-1 and 2
1 and 2
-1 and -2
Explanation:
According to the Division Algorithm -1 = 3(-1) + 2. Hence, quotient when -1 divided by 3 is -1 = -1 div 3 and remainder when -1 divided by 3 is 2 = -1 mod 3.
Question 5
Marks : +2 | -2
Pass Ratio : 100%
Is 102 congruent to 6 modulo 16.
True
False
Explanation:
16 divide 102 – 6 = 96.
Question 6
Marks : +2 | -2
Pass Ratio : 100%
In ________ search each element is compared with x till not found.
Binary
Sequential
Merge
None of the mentioned
Explanation:
In linear or sequential search entire list is searched sequentially for x.
Question 7
Marks : +2 | -2
Pass Ratio : 100%
An algorithm is a _________ set of precise instructions for performing computation.
Infinite
Finite
Constant
None of the mentioned
Explanation:
By the definition of an algorithm.
Question 8
Marks : +2 | -2
Pass Ratio : 100%
List obtained in third pass of selection sort for list 3, 5, 4, 1, 2 is ___________
1, 2, 4, 3, 5
1, 2, 3, 4, 5
1, 5, 4, 3, 2
3, 5, 4, 1, 2
Explanation:
The selection sort begins with finding the least element in the list. This element is moved to front and then the least element among the remaining elements. Is found and put into the second position and so on.
Question 9
Marks : +2 | -2
Pass Ratio : 100%
The Worst case occur in linear search algorithm when _________
Item is somewhere in the middle of the array
Item is not in the array at all
Item is the last element in the array
Item is the last element in the array or is not there at all
Explanation:
The Worst case occur in linear search algorithm when Item is the last element in the array or is not there at all.
Question 10
Marks : +2 | -2
Pass Ratio : 100%
The operation of processing each element in the list is known as _________
Sorting
Merging
Inserting
Traversal
Explanation:
The operation of processing each element in the list is known as Traversal.