Click here to Skip to main content
15,886,840 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
find number of inversions in array
Where array are randomly 1 to 100000 ????
Posted
Comments
Sergey Alexandrovich Kryukov 1-Feb-13 2:32am    
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    
I'm new to it..... please, tell me your solution..

I suspect Google won't be of any help in your case: "About 3,240,000 results"[^].
 
Share this answer
 
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;
no= Console.ReadLine();
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];
}
console.writeLine("your reverse array is:");
for(i=0;i<array.lenght;i++)>
{
 console.writeLine(temp[i]);
}
</data>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900