Monday, July 27, 2009

Can i have a source code of sorting in c++ compiler please.......?????

This is how it would look in c#, which is really really close. The example is a selection sort. I code for a living. I haven't tested this code. Good luck. PLEASE try to understand it before you turn in your assignment. This code would be indented, but yahoo takes out the extra white space.





Lets say that arrayToSort is the name of the array you are going to sort.





for(int a = 1; a %26lt; arrayToSort.Length; a++)


for(int b = 0; b %26lt; a; b++)


if (arrayToSort[b] %26gt; arrayToSort[a])


{


int temp = arrayToSort[b];


arrayToSort[b] = arrayToSort[a];


arrayToSort[a] = temp;


}

Can i have a source code of sorting in c++ compiler please.......?????
http://www.google.nl/search?hl=en%26amp;q=sort...


No comments:

Post a Comment