Изменил(а) на '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 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;
    }
   }