mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-22 05:21:49 +03:00
apply snake case
This commit is contained in:
parent
e81bc16832
commit
e2add348d9
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int i, arraySort[MAX] = {0}, isSort = FALSE, changePlace;
|
int i, array_sort[MAX] = {0}, is_sorted = FALSE, change_place;
|
||||||
|
|
||||||
/* For example
|
/* For example
|
||||||
Insertion random values in array to test
|
Insertion random values in array to test
|
||||||
@ -14,23 +14,23 @@ int main()
|
|||||||
|
|
||||||
for (i = 0; i < MAX; i++)
|
for (i = 0; i < MAX; i++)
|
||||||
{
|
{
|
||||||
arraySort[i] = rand() % 101;
|
array_sort[i] = rand() % 101;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Algorithm of bubble methods */
|
/* Algorithm of bubble methods */
|
||||||
|
|
||||||
while (isSort)
|
while (is_sorted)
|
||||||
{
|
{
|
||||||
isSort = FALSE;
|
is_sorted = FALSE;
|
||||||
|
|
||||||
for (i = 0; i < MAX - 1; i++)
|
for (i = 0; i < MAX - 1; i++)
|
||||||
{
|
{
|
||||||
if (arraySort[i] > arraySort[i + 1])
|
if (array_sort[i] > array_sort[i + 1])
|
||||||
{
|
{
|
||||||
changePlace = arraySort[i];
|
change_place = array_sort[i];
|
||||||
arraySort[i] = arraySort[i + 1];
|
array_sort[i] = array_sort[i + 1];
|
||||||
arraySort[i + 1] = changePlace;
|
array_sort[i + 1] = change_place;
|
||||||
isSort = TRUE;
|
is_sorted = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ int main()
|
|||||||
|
|
||||||
for (i = 0; i < MAX; i++)
|
for (i = 0; i < MAX; i++)
|
||||||
{
|
{
|
||||||
printf("%d\n", arraySort[i]);
|
printf("%d\n", array_sort[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user