Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

dualSort

void dualSort(int accountNumbers[], double accountBalances[], int ARRAY_SIZE)
{
 int minIndex;

 for(int i = 0; i < ARRAY_SIZE - 1; i++)
 {
  minIndex = i;

  for(int j = i + 1; j < ARRAY_SIZE; j++)
  {
   if(accountNumbers[j] < accountNumbers[minIndex])
   {
    minIndex = j;
   }
  }

  swap(accountNumbers[i], accountNumbers[minIndex]);
  swap(accountBalances[i], accountBalances[minIndex]);
 }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #dualSort
ADD COMMENT
Topic
Name
9+3 =