Created
March 18, 2014 03:28
-
-
Save utjacob/9613054 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void stockSort(char a) { | |
int i =1; | |
int j =1; | |
int flag = 1; | |
int yearTemp = 0; | |
int stockTemp = 0; | |
string modelTemp = "null"; | |
//MakeTemp | |
//MilesTemp | |
//PriceTemp | |
for(i=1; (i <= MAX) && flag; i++) { // i = 3, | |
flag = 0; //set to false | |
for(j =0; j < (MAX -1); j++) { | |
if(stockAry[j+1] > stockAry[j]) { | |
yearTemp = yearAry[j]; | |
stockTemp = stockAry[j]; | |
modelTemp = modelAry[j]; | |
//MakeTemp | |
//MilesTemp | |
//PriceTemp | |
yearAry[j] = yearAry[j+1]; | |
stockAry[j] = stockAry[j+1]; | |
modelAry[j] = modelTemp[j+1]; | |
//MakeAry j = j+1 | |
//MilesAry j = j+1 | |
//PriceAry j = j+1 | |
yearAry[j+1] = yearTemp; | |
stockAry[j+1] = stockTemp; | |
modelAry[j+1] = modelTemp; | |
//MakeAry j+1 = temp | |
//MilesAry j+1 = temp | |
//PriceAry j+1 = temp | |
flag = 1; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment