Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in c++ programming code do the following: 2. If your nameArray variable is sorted using Bubble Sort Algorithm, it will go through a several pass-throughs
in c++ programming code do the following:
2. If your nameArray variable is sorted using Bubble Sort Algorithm, it will go through a several pass-throughs and characters will be swapped in each pass-through, until nameArray gets completed sorted (alphabetically ascending order). Show all these stages (Passes and iterations within Passes) for your nameArray. Based on our example, here is a sample of how I want you to write these steps ass JO NP DOEOJN P DOE Note: O and J were swapped O J N] P D OEO IN J P DOE Note: N and J were swapped O J N] P D OEO IN J P DOE Note: N and J were swapped ONU P DOE ON [J P] DOE No Swap ONJ [P D OEONJ [D P OE Note: D and P were swapped ONJDIP OEONJD[O P]E Note: O and P were swapped ONJDOP E>ONJDO E P Note: E and P were swapped ass-2 ON JDOPEON JDOEP Note: No Swap ON J D OPE OUN] DOEP Note: J and N were swapped .(so on, until the array is completely sorted) How many passes were required? How many iterations within each pass? How many swaps were performed? 3. Repeat the same process with nameArray and this time show the stages when Selection Sort Algorithm is used How many iterations were requiredStep 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