Write a program to sort an array using the bubble sort algorithm.
HardProblem Statement
Write a program to sort an array using the bubble sort algorithm.
Sample Input
int arr[] = {5, 2, 9, 1};Sample Output
Sorted array: 1 2 5 9
Limits
Time: 2s · Memory: 256 MB