Question

1.Show the state of the following array after the outer loop of the bubble sort algorithm...

1.Show the state of the following array after the outer loop of the bubble sort algorithm has executed one time.

[0] [1] [2] [3] [4] [5]
19 23 2 4 99

1

2.

Show the state of the following array after the outer loop of the selection sort algorithm has executed two times.

[0] [1] [2] [3] [4] [5]
12 1 9 23 17 11

3.

Show the state of the following array after the outer loop of the insertion sort algorithm has executed two times.

[0] [1] [2] [3] [4] [5]
19 23 2 4 99 1
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Below is the solution:

1.given the array 19,23,2,4,99,1

When the given array apply on bubble sort the first outer loop the array will be:

19,2,4,23,99,1

2, given array 12,1,9,23,17,11 apply the bubble sort the 2nd outer loop after execution the array will be:

1,12,9,23,17,11

3. Given the array 19,23,24,99,1 the execution of the outer loop of the 3rd time the array will be

2,19,23,4,99,1

Add a comment
Know the answer?
Add Answer to:
1.Show the state of the following array after the outer loop of the bubble sort algorithm...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT