• edited by
80 views
0 0 votes

Let $A[1 \ldots n]$ be an array of $n$ distinct numbers. The pair ( $\mathrm{i}, \mathrm{j}$ ) is called an inversion of $A$, if

  1. $\mathrm{i}>\mathrm{j}$ and $A[\mathrm{i}]>A[\mathrm{j}]$
  2. $\mathrm{i}>\mathrm{j}$ and $A[\mathrm{i}]=A[\mathrm{j}]$
  3. $\mathrm{i}<\mathrm{j}$ and $A[\mathrm{i}]>A[\mathrm{j}]$
  4. $\mathrm{i}<\mathrm{j}$ and $A[\mathrm{i}]<A[\mathrm{j}]$

Please log in or register to answer this question.

Position:
Show:

Related questions

0 0 votes
0 0 answers
132
132 views
Shubham Sharma 2 asked Oct 22, 2025
132 views
The bound $2 n^{2}=\mathrm{O}\left(n^{2}\right)$ isnot asymptotically tightasymptotically tightpositive constant if $\mathrm{n}<0$negative constant if $\mathrm{n}>0$
0 0 votes
0 0 answers
107
107 views
Shubham Sharma 2 asked Oct 22, 2025
107 views
Which one of the following sorting algorithms of quadratic time complexity is preferred in practice for small problem size?Insertion sortSelection sortBubble sortRecursiv...
0 0 votes
0 0 answers
107
107 views
Shubham Sharma 2 asked Oct 22, 2025
107 views
In transpose symmetry, $\mathrm{f}(\mathrm{n})=\mathrm{O}(\mathrm{g}(\mathrm{n}))$ if and only if$\mathrm{g}(\mathrm{n})=\mathrm{o}(\mathrm{f}(\mathrm{n}))$$\mathrm{g}(\m...
0 0 votes
0 0 answers
75
75 views
Shubham Sharma 2 asked Oct 22, 2025
75 views
Consider the recurrence equation that has upper bounds $\mathrm{T}(\mathrm{n})$ as given below :$\begin{array}{l}T(1)=1 \\T(n)=2 T(n-1)+n, \text { for } n \geq 2 .\end{ar...