Answered step by step
Verified Expert Solution
Question
1 Approved Answer
complete the following in c++ programming code and answer question 3. use question 2 below as reference 2. If your nameArray variable is sorted using
complete the following in c++ programming code and answer question 3. use question 2 below as reference
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: Pass-1 [JOINPDOE==> [O N P D O E [J N] P D O E ==> 0 [NJ] P D O E Note: O and J were swapped Note: N and J were swapped ONJ P D OEONJ D P OE Note: D and P were swapped O N J D [P O] E ==> O N J D [O P] E Note: O and P were swapped O N J D O [PE] ==> O N J D O [EP] Note: E and P were swapped Pass-2: [O N] J DOPE==> [O NI J DOEP O [NJ] D O P E ==> 0 [J N] D O E P Note: No Swap 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? HOW STEPS OF BUBBLE SORT APPLIED ON YOUR NAME ARRAY SHOWN IT ANSWER 3. Repeat the same process with nameArray and this time show the stages when Selection Sort Algorithm is used. How many iterations were required? N YOUR NAME 2. ANSWER THEStep 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