Question
Exercise 3: Sorting (10 points) void mysort(int a[], int len); Write a function called mysort that rearranges elements of an array a so that they
Exercise 3: Sorting (10 points)
void mysort(int a[], int len);
Write a function called mysort that rearranges elements of an array a so that they form an increasing sequence of values. Allow for different array positions to contain the same value.
Develop your own sorting algorithm; do not use a predefined sort routine from the standard library.
Implement a simple sorting algorithm rather than an efficient algorithm.
please use the bubble sort and the main function.
here is what I came up with:
#include
int main (){ int a[8] = {19, 5, 77, 101, 43, 76, 19, 8}; cout << "Sorted values: " << mysort(a, 8)<< endl; return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started