cpplint issues fixed in sorting folder

This commit is contained in:
Krishna Vedala 2020-05-26 13:07:14 -04:00
parent 01b69fcb24
commit 35c53760d3
No known key found for this signature in database
GPG Key ID: BA19ACF8FC8792F7
2 changed files with 9 additions and 9 deletions

View File

@ -55,4 +55,4 @@ int main(int argc, char const* argv[]) {
radixsort(a, n);
print(a, n);
return 0;
}
}

View File

@ -9,7 +9,6 @@
// while being slow, must still all the time be working towards a result.
#include <iostream>
using namespace std;
void SlowSort(int a[], int i, int j) {
if (i >= j) return;
@ -30,26 +29,27 @@ void SlowSort(int a[], int i, int j) {
int main() {
int size;
cout << "\nEnter the number of elements : ";
std::cout << "\nEnter the number of elements : ";
cin >> size;
std::cin >> size;
int *arr = new int[size];
cout << "\nEnter the unsorted elements : ";
std::cout << "\nEnter the unsorted elements : ";
for (int i = 0; i < size; ++i) {
cout << "\n";
cin >> arr[i];
std::cout << "\n";
std::cin >> arr[i];
}
SlowSort(arr, 0, size);
cout << "Sorted array\n";
std::cout << "Sorted array\n";
for (int i = 0; i < size; ++i) {
cout << arr[i] << " ";
std::cout << arr[i] << " ";
}
delete[] arr;
return 0;
}