Question

1. Compare and contrast: SORTING -a bubble sort through an array -a selection sort through an...

1. Compare and contrast: SORTING

-a bubble sort through an array

-a selection sort through an array

Explain how each works and what the advantages and disadvantages are.

Note the efficiency of each.

2. Compare and contrast: SEARCHING

-a sequential search through a file

-a sequential search through an array

-a binary search through an array

Explain how each works and what the advantages and disadvantages are.

Note the efficiency of each.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1) i) Bubble sort: In bubble sort the time taken is Θ(n^2).

ii) Selection sort: Even in selection sort the time taken is Θ(n^2).

Selection sort is faster and more effecient than bubble sort. There are even less writes in selection sort. Bubble sort has no advantages over selection sort.

Add a comment
Know the answer?
Add Answer to:
1. Compare and contrast: SORTING -a bubble sort through an array -a selection sort through an...
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