Question: In the program you are given, bubble sort has been implemented as a function that takes an array arr and the number of its elements
In the program you are given, bubble sort has been implemented as a function that takes an array arr and the number of its elements size and returns the sorted array. However, the code contains an error and the array in not sorted when the function returns. Taskl: Fix the code of the bubble sort function so it returns an array correctly sorted. Use the following array with 5 elements; 6, 4, 7, 1,9 Task 2: Improve the program by making in take any size array using dynamic memory allocation. The user would enter the number of elements in the array, the program will store that number in a variable size, and create an array of integers large enough to hold size values (use the operator new)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
