Изменил(а) на 'cv2/program.c'

This commit is contained in:
Oleksandr Hryshchenko 2021-11-09 09:26:25 +00:00
parent 2e11a7a179
commit 158a70911c

View File

@ -15,15 +15,15 @@ int comparator (const void * p1, const void * p2){
int* insertSort(int* array, int size){ int* insertSort(int* array, int size){
 int temp;  int temp;
 for(int i = 1; i < size; i++){  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--){    for(int j = i-1; j >= 0; j--){
    if(array[i] >= array[j]){     if(array[i].price >= array[j].price){
     break;      break;
    }     }
    else{     else{
     temp = array[j];      temp = array[j].price;
     array[j] = array[i];      array[j].price = array[i].price;
     array[i] = temp;      array[i].price = temp;
     i = j;      i = j;
    }     }
   }    }