Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sorting/tim_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void insertionSort(int arr[], int left, int right) {
for (int i = left + 1; i <= right; i++) {
const int temp = arr[i];
int j = i - 1;
while (arr[j] > temp && j >= left) {
while (j >= left && arr[j] > temp) {
arr[j + 1] = arr[j];
j--;
}
Expand Down Expand Up @@ -92,7 +92,7 @@ void printArray(int arr[], int n) {
}

/**
* @brief self-test implementation
* @brief self-test implementation
* @returns void
*/
void tests() {
Expand All @@ -110,7 +110,7 @@ void tests() {

// Driver program to test above function
int main() {
tests(); // run self test implementations
tests(); // run self test implementations

int arr[] = {5, 21, 7, 23, 19};
const int n = sizeof(arr) / sizeof(arr[0]);
Expand Down
Loading