1,132 views
0 0 votes

The average number of inversions in an unsorted array of n elements is?

(Two elements a[i] and a[j] form an inversion if a[i] > a[j] and i < j)

A.) n(n-1)/2

B.) n(n-1)/4

C.) n(n+1)/2

D.) n!/2

Please log in or register to answer this question.

Position:
Show:

Related questions

0 0 votes
1 1 answer
1.7k
1.7k views
Lakshman Bhaiya asked Nov 1, 2018
1,748 views
$(1)$Give $"logn"$ Sorted lists each of size $"\frac{n}{logn}",$what is the total time required to merge them into one single list?$(2)"n"$ strings each of length $"n"$ a...
0 0 votes
2 2 answers
1.0k
1.0k views
argha1992 asked Oct 27, 2018
1,023 views
What is the average case time complexity of the best sorting algorithm for an array having 2^n^2 elements .I know that the best sorting algorithm is no better than O(n lo...
3 3 votes
0 0 answers
1.5k
1.5k views
sh!va asked Aug 6, 2016
1,488 views
A and B are sorting a set of decimal numbers.A's approach:The elements put in 'buckets' of incremental ranges (e.g. 0-9, 10-19, ... 90-99)Each 'bucket' is sorted and mer...
9 9 votes
6 6 answers
4.0k
4.0k views
Arjun asked Feb 27, 2025
3,969 views
Suppose that insertion sort is applied to the array $[1,3,5,7,9,11, x, 15,13]$ and it takes exactly two swaps to sort the array. Select all possible values of $x$.$10$$12...