Explore topic-wise MCQs in Count Inversion Multiple Choice.

This section includes 12 Mcqs, each offering curated multiple-choice questions to sharpen your Count Inversion Multiple Choice knowledge and support exam preparation. Choose a topic below to get started.

1.

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» B. O(log n)
2.

The time complexity of the code that determines the number of inversions in an array using self balancing BST is lesser than that of the code that uses loops for the same purpose.

A. true
B. false
Answer» B. false
3.

What is the time complexity of the code that uses self balancing BST for determining the number of inversions in an array?

A. O(n<sup>2</sup>)
B. O(n)
C. O(log n)
D. O(n log n)
Answer» E.
4.

What is the time complexity of the code that uses merge sort for determining the number of inversions in an array?

A. O(n<sup>2</sup>)
B. O(n)
C. O(log n)
D. O(n log n)
Answer» E.
5.

The time complexity of the code that determines the number of inversions in an array using merge sort is lesser than that of the code that uses loops for the same purpose.

A. true
B. false
Answer» B. false
6.

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» C. (1,5), (1,4), (1,2)
7.

How many inversions are there in the array arr = {1,5,4,2,3}?

A. 0
B. 3
C. 4
D. 5
Answer» E.
8.

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» B. when the array is reverse sorted
9.

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» C. when the array is half sorted
10.

What is the condition for two elements arr[i] and arr[j] to form an inversion?

A. arr[i]&lt;arr[j]
B. i &lt; j
C. arr[i] &lt; arr[j] and i &lt; j
D. arr[i] &gt; arr[j] and i &lt; j
Answer» E.
11.

How many inversions does a sorted array have?

A. 0
B. 1
C. 2
D. cannot be determined
Answer» B. 1
12.

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» C. the distribution of values in the array