answer and complete the following for c++ programming(answer each seperately) 2.
ID: 3721796 • Letter: A
Question
answer and complete the following for c++ programming(answer each seperately)
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 THE QUESTIONExplanation / Answer
Hi,
Its against chegg policy to post multiple questions as one, please post other one as separate question.
2.
Since your name is not given, i am going to go ahead with a generic example , i am going to use my name array which is 'B H A R G A V'
Firstly, lets understand bubble sort, this algorithm works by repeatedly swapping the adjacent elements if they are in wrong order.
Thumbs up if this was helpful, otherwise let me know in comments
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.