You are viewing a single comment's thread. Return to all comments →
My C code 😎😁
int runningTime(int arr_count, int* arr) { int nbrOperation = 0; for(int i = 1;i < arr_count; i++){ int cle = arr[i]; int j = i - 1; while(j >= 0 && arr[j] > cle){ arr[j + 1] = arr[j]; j--; nbrOperation++; } arr[j + 1] = cle; } return nbrOperation; }
Seems like cookies are disabled on this browser, please enable them to open this website
Running Time of Algorithms
You are viewing a single comment's thread. Return to all comments →
My C code 😎😁