Answered step by step
Verified Expert Solution
Question
1 Approved Answer
What is the purpose of this code and what improvements should be made to it: #include void funnyFunction ( int array [ ] , int
What is the purpose of this code and what improvements should be made to it: #include
void funnyFunctionint array int size
forint i ; i arrayjwhen the current item is bigger than next
int temp;
temp arrayj;
arrayj arrayj;
arrayj temp;
swaps ; set swap flag
ifswaps
break; No swap in this pass, so array is sorted
int main
int n;
n ;
int arr; initialize an array
printfArray before funnyFunction: ;
forint i ; i
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