Question: write code in C++ Consider the below array of 8 numbers and show each step i.e. the array after each iteration of the outer loop.

write code in C++
Consider the below array of 8 numbers and show each step i.e. the array after each iteration of the outer loop. If your registration number is even then you have to apply insertion sort else you have to apply selection sort. The array is (21,3,5, (your registration number),10, 1, 8, 2] -> if your registration number is 15 then the array you have to sort is [21,3,5. 15,10,1.8.2]. Show the changes in values after each iteration: 3 5 No. of No. of Complexity Reg# comparisons swaps/shifts 21 Your 10 1 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
