12,747,719 members (41,991 online)
Rate this:
See more:
find number of inversions in array
Where array are randomly 1 to 100000 ????
Posted 31-Jan-13 21:17pm
Sant Osha1.6K

What is "randomly"? length? values? Who cares if it is random or not, the problem is the same.
Anyway, what did you try?
By the way, programming is not needed here, only some mathematics...
—SA
Sant Osha 1-Feb-13 2:59am

Rate this:

Rate this:

## Solution 2

hi
if you want to make a number inverse then follow the follow the following code:
```console.writeLine("Enter the position of the number for reverse :");
int no,rem,rev=0;
while(no!=0)
{
rem=no%10;
rev=rev*10+rem;
no=no/10;

}
```

if you want to inversion of the array then use the following:
```int count,no,j,i;
<data type=""> array[],temp[];
for(i=0;i<array.lenght;i++);>
for(j=0;i>=0,j<array.lenght;i--,j++)>
{
temp[j]=array[i];
}
for(i=0;i<array.lenght;i++)>
{
console.writeLine(temp[i]);
}
</data>```

Top Experts
Last 24hrsThis month
 Graeme_Grant 330 Karthik Bangalore 195 Dave Kreskowiak 118 Maciej Los 115 OriginalGriff 110
 OriginalGriff 3,668 Peter Leow 2,761 ppolymorphe 2,023 Karthik Bangalore 1,870 Richard MacCutchan 1,349