-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
38 lines (33 loc) · 817 Bytes
/
main.c
File metadata and controls
38 lines (33 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <stdio.h>
#include "headers/sorting.h" // Include the header file from the 'headers' folder
int main()
{
int arr[] = {5, 3, 8, 4, 2};
int n = 5;
// Print the original array
printf("Original array: ");
for (int i = 0; i < n; i++)
{
printf("%d ", arr[i]);
}
printf("\n");
// Sort the array using Bubble Sort
bubbleSortInt(arr, n);
printf("Sorted array using Bubble Sort: ");
for (int i = 0; i < n; i++)
{
printf("%d ", arr[i]);
}
printf("\n");
int arr2[] = {10, 7, 8, 9, 1, 5};
int n2 = 6;
// Sort the array using Quick Sort
quickSortInt(arr2, 0, n2 - 1);
printf("Sorted array using Quick Sort: ");
for (int i = 0; i < n2; i++)
{
printf("%d ", arr2[i]);
}
printf("\n");
return 0;
}