We have the best collection of the Count Inversion MCQs and answer with FREE PDF. These Count Inversion MCQs will help you to prepare for any competitive exams like: BCA, MCA, GATE, GRE, IES, PSC, UGC NET, DOEACC Exams at all levels – you just have to practice regularly.
Contents
Count Inversion MCQs
1. What is the time complexity of the code that uses merge sort for determining the number of inversions in an array?
a) O(n2)
b) O(n)
c) O(log n)
d) O(n log n)
Answer: O(n log n)
2. What is the time complexity of the code that uses self balancing BST for determining the number of inversions in an array?
a) O(n2)
b) O(n)
c) O(log n)
d) O(n log n)
Answer: O(n log n)
3. What is the space complexity of the code that uses merge sort for determining the number of inversions in an array?
a) O(n)
b) O(log n)
c) O(1)
d) O(n log n)
Answer: O(n)
4. Under what condition the number of inversions in an array are maximum?
a) when the array is sorted
b) when the array is reverse sorted
c) when the array is half sorted
d) depends on the given array
Answer: when the array is reverse sorted
5. Under what condition the number of inversions in an array are minimum?
a) when the array is sorted
b) when the array is reverse sorted
c) when the array is half sorted
d) depends on the given array
Answer: when the array is sorted
6. How many inversions are there in the array arr = {1,5,4,2,3}?
a) 0
b) 3
c) 4
d) 5
Answer: 5
7. Which of the following form inversion in the array arr = {1,5,4,2}?
a) (5,4), (5,2)
b) (5,4), (5,2), (4,2)
c) (1,5), (1,4), (1,2)
d) (1,5)
Answer: (5,4), (5,2), (4,2)
8. What does the number of inversions in an array indicate?
a) mean value of the elements of array
b) measure of how close or far the array is from being sorted
c) the distribution of values in the array
d) median value of the elements of array
Answer: measure of how close or far the array is from being sorted
9. How many inversions does a sorted array have?
a) 0
b) 1
c) 2
d) cannot be determined
Answer: 0
10. What is the condition for two elements arr[i] and arr[j] to form an inversion?
a) arr[i]<arr[j]
b) i < j
c) arr[i] < arr[j] and i < j
d) arr[i] > arr[j] and i < j
Answer: arr[i] > arr[j] and i < j
Count Inversion MCQs PDF Download
Also Read about Arrays Types
1000+ Data Structure MCQs
Abstract Data Types |
Application of Stacks |
Arrays Types |
Types of Lists |
Binary Trees |
B-Trees |
Trees |
Heap |
Trie |
Hash Tables |
Graph |