void wingspanSort(struct Penguin_t *data, int size, int wingspan[50])
{
int min_index, min_value, temp;
int i, j;
for (i=0; i < size-1; i++)
{
//set the position to the current index of the array
min_index = i;
//One by one move boundary of unsorted subarray
for (j=i+1; j < size; j++)
{
//Find the minimum element in unsorted array
if (data[j].physique.wingspan < data[min_index].physique.wingspan)
{
min_index=j;
min_value=data[j].physique.wingspan;
wingspan[i] = data[min_index].ID;
cout << "i: "<<i<< " min_index: "<< min_index << " min_value: "<< min_value<< " ID: "<< wingspan[i]<<endl;
}
}
// if position is no longer = i then a smaller value must have been found; so swap it
if (min_index != i)
{
temp = data[i].physique.wingspan;
data[i].physique.wingspan = data[min_index].physique.wingspan;
data[min_index].physique.wingspan = temp;
}
}
}
void neurosisCategory(struct Penguin_t *data, int size, int neurosis[50][4])
{
int i, j;
// initialize array
for (i=0; i<size; i++)
{
for (j=0; j<4; j++)
{
neurosis[i][j] = -1;
}
}
void selectionSort(int arr[], int size)
{
int min_index, temp;
for (int i=0; i< size-1; i++)
{
//set the position to the current index of the array
min_index = i;
//One by one move boundary of unsorted subarray
for (int j=i+1; j < size; j++)
{
//Find the minimum element in unsorted array
if (arr[j] < arr[min_index])
min_index=j;
}
// if position is no longer = i then a smaller value must have bee found; so swap it
if (min_index != i)
{
temp = arr[i];
arr[i] = arr[min_index];
arr[min_index] = temp;
}
}
}
void printArray(int arr[], int size) {
for (int i=0; i<size; i++)
{
cout << arr[i] << endl;
}
}