Answers for "dualSort"

C++
0

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]);
 }
}
Posted by: Guest on May-05-2022

Browse Popular Code Answers by Language