Question: given is the following array of elements named list and according to the rearrangement of the algorithm do a bubble sorting and answer following questions.

given is the following array of elements named list and according to the rearrangement of the algorithm do a bubble sorting and answer following questions.
please explain bit confused.
given is the following array of elements named list and according to
the rearrangement of the algorithm do a bubble sorting and answer following

1. Your task is to write the algorithm for bubble sort using the same style and notation as the simple number-doubling algorithm on the previous page. Your lab instructor will write a number of algorithm steps on the whiteboard. Your task is to arrange these steps in the correct order such that the resulting algorithm implements the bubble sort algorithm (ascending sort) for an array that contains 5 numbers. list: 9 7 2 6 1 1 2. Once you think your algorithm is correct, test it using the array list on page 1. As you test your algorithm, write the contents of the array, as well as any other variables, after each step in the algorithm is executed (like Figure 1). If your algorithm does not give the required result, find your error and reorder the given algorithm steps. Then retest it and show the results (like Figure 1). 3. Once you have the correct order of steps such that the algorithm is correct, consider the efficiency of this bubble sort algorithm. Algorithm efficiency refers to the amount of resources required to execute the algorithm. In this lab, consider how many times the various steps in the bubble sort algorithm are executed as the array is sorted. Can you see an inefficiency in the algorithm and a way to fix it? Briefly describe the inefficiency and how to fix it. 4. Write out your improved algorithm and test it using the array on page 1. Show your test results (like Figure 1). Bubble Sort algorithm: (Rearrange these if list(count) > list(count+1) then swap list(count) with list(count+1) and set swap to true if swap is false then sorting is complete, so stop here . if count

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!