12,254,932 members (62,094 online)
Rate this:
See more:
find number of inversions in array
Where array are randomly 1 to 100000 ????
Posted 31-Jan-13 20: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
 OriginalGriff 474 CHill60 285 KARTHIK Bangalore 175 ppolymorphe 173 Dave Kreskowiak 170
 OriginalGriff 2,308 CHill60 1,605 ppolymorphe 1,373 George Jonsson 1,250 Dave Kreskowiak 1,112

Web01 | 2.8.160426.1 | Last Updated 2 Feb 2013