exp 10: call bubble_sort

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2022-12-28 05:58:17 +05:30
parent 869d3051f2
commit 6e31a2402f
2 changed files with 7 additions and 1 deletions

8
10.c
View File

@@ -31,7 +31,7 @@ void insertion_sort(int arr[], int n) {
}
}
void bubble(int arr[], int n) {
void bubble_sort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
int swapped = 0;
@@ -171,5 +171,11 @@ int main() {
heap_sort(arr5, SIZE);
display(arr5, SIZE);
int arr6[] = {1, 10, -100000, 1, -2};
printf("Bubble Sort on: ");
display(arr6, SIZE);
bubble_sort(arr6, SIZE);
display(arr6, SIZE);
return 0;
}