diff --git a/cv2/program.c b/cv2/program.c index 8a5c7bc..1c92c12 100644 --- a/cv2/program.c +++ b/cv2/program.c @@ -15,15 +15,15 @@ int comparator (const void * p1, const void * p2){ int* insertSort(int* array, int size){  int temp;  for(int i = 1; i < size; i++){ -  if(array[i] < array[i-1]){ +  if(array[i].price < array[i-1].price){    for(int j = i-1; j >= 0; j--){ -    if(array[i] >= array[j]){ +    if(array[i].price >= array[j].price){      break;     }     else{ -     temp = array[j]; -     array[j] = array[i]; -     array[i] = temp; +     temp = array[j].price; +     array[j].price = array[i].price; +     array[i].price = temp;      i = j;     }    }