Hey Guys! I want to execute below code using 'NEXT' button ,
for (int j = 1; j < myArray.Length; j++)
{
int key = myArray[j];
int i = j - 1;
while (i >= 0 && myArray[i] > key)
{
int temp = key;
myArray[i + 1] = myArray[i];
myArray[i] = temp;
i = i - 1;
}
}
Like this:http://www.cs.oswego.edu/~mohammad/classes/csc241/samples/sort/Sort2-E.html I want to run this code's each line when my "NEXT" button push. I mean 1st code line run when 1st time push button clicked, and 2nd line run after 2nd time clicked 'NEXT' button!
I really would appreciate some help or at least a point in the right direction. I generally search in google, but have been doing so for hours with no luck. Hopefully someone here can help?
Loading
VulpesPosted Aug 30, 2011, 6:57 AM
Hasitha LiyanagePosted Aug 30, 2011, 11:59 AM
Hasitha LiyanagePosted Aug 29, 2011, 10:33 PM
If you can suggest a way to do this im really thankful to you!
VulpesPosted Aug 29, 2011, 1:43 PM