Algorithms

Question 1
Marks : +2 | -2
Pass Ratio : 100%
The value of 155 mod 9 is?
0
1
2
3
Explanation:
By the Division algorithm 155 = 9(17) + 2. Where remainder is 155 mod 9.
Question 2
Marks : +2 | -2
Pass Ratio : 100%
To sort a list with n elements, the insertion sort begins with the __________ element.
First
Second
Third
Fourth
Explanation:
The insertion sort compares the second element with the first element to start sorting.
Question 3
Marks : +2 | -2
Pass Ratio : 100%
Is 102 congruent to 6 modulo 16.
True
False
Explanation:
16 divide 102 – 6 = 96.
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%
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.
Question 6
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 7
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 8
Marks : +2 | -2
Pass Ratio : 100%
The worst case complexity for insertion sort is _________
O(n)
O(log n)
O(n2)
O(n log n)
Explanation:
In worst case nth comparison are required to insert the nth element into correct position.
Question 9
Marks : +2 | -2
Pass Ratio : 100%
The worst case occurs in quick sort when _________
Pivot is the median of the array
Pivot is the smallest element
Pivot is the middle element
None of the mentioned
Explanation:
This happens when the pivot is the smallest (or the largest) element. Then one of the partitions is empty, and we repeat recursively the procedure for N-1 elements.
Question 10
Marks : +2 | -2
Pass Ratio : 100%
The complexity of Bubble sort algorithm is _________
O(n)
O(log n)
O(n2)
O(n log n)
Explanation:
The complexity of Bubble sort algorithm is O(n2).