formatting source-code for d7af6fdc8c

This commit is contained in:
github-actions
2020-05-29 23:26:30 +00:00
parent edb3d51ec2
commit 7ad1f171c1
176 changed files with 5342 additions and 4288 deletions

View File

@@ -5,18 +5,14 @@ using namespace std;
void countSort(string arr)
{
string output;
int count[256], i;
for (int i = 0; i < 256; i++)
count[i] = 0;
for (int i = 0; i < 256; i++) count[i] = 0;
for (i = 0; arr[i]; ++i)
++count[arr[i]];
for (i = 0; arr[i]; ++i) ++count[arr[i]];
for (i = 1; i <= 256; ++i)
count[i] += count[i - 1];
for (i = 1; i <= 256; ++i) count[i] += count[i - 1];
for (i = 0; arr[i]; ++i)
{
@@ -24,8 +20,7 @@ void countSort(string arr)
--count[arr[i]];
}
for (i = 0; arr[i]; ++i)
arr[i] = output[i];
for (i = 0; arr[i]; ++i) arr[i] = output[i];
cout << "Sorted character array is " << arr;
}