From 158a70911c7d05458901575da9c72cca36359602 Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Tue, 9 Nov 2021 09:26:25 +0000 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'cv2/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cv2/program.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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;     }    }