Compare commits

..

No commits in common. "c4b219c556017fe6eff32c1668df5ae46da2fa56" and "32f22232c451c90bb44ede5c76e29ebb5f00eb93" have entirely different histories.

3 changed files with 1 additions and 52 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
*.exe
.vscode

View File

@ -1,49 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#define ARRAYLENGTH 100
void generateRandomArray(int *array)
{
for (size_t i = 0; i < ARRAYLENGTH; i++)
{
array[i] = rand();
}
}
void printArrayContent(int *array)
{
for (size_t i = 0; i < ARRAYLENGTH; i++)
{
printf("%d ", array[i]);
}
printf("\n");
}
void sortArray(int *array)
{
for (size_t i = 0; i < ARRAYLENGTH - 1; i++ )
{
for (size_t j = 0; j < ARRAYLENGTH - 1 - i; j++)
{
if (array[j] > array[j+1])
{
int temp = array[j+1];
array[j+1] = array[j];
array[j] = temp;
}
}
}
}
int main(int argc, char *argv[])
{
int array[ARRAYLENGTH];
generateRandomArray(array);
sortArray(array);
printArrayContent(array);
return 1;
}

View File

@ -11,4 +11,4 @@ For my own personal revision, all implementations were initially attemped using
### Algorithms
- [Bubble Sort](bubblesort\main.c)
- TBA