Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Activity 10: Complete table of runtimes & advantages/ disadvantages for common a

ID: 3738086 • Letter: A

Question

Activity 10: Complete table of runtimes & advantages/ disadvantages for common algorithms You are welcome to use the class notes & information you find online to complete the table, although you should try to think through the cases before looking up the answers. Make sure you understand why these runtimes are what they are. What size/ arrangement of input causes the best case? The worst case? Your solutions will be part of your submission. Best Case Average Case Worst Case Advantage(s) Disadvantage(s) Algorithm Linear Search Binary Search Bubble Sont Insertion Sort Selection Sort Merge Sort

Explanation / Answer

It is more complicated than linear search.because ,It works only on lists that are sorted and kept sorted.

Easy to understand & implement.

In-place,No extra memory is needed.

It does not perform as well as other ,better sorting algorithms.

It is useful ,only when sorting a list of few items.

Merge Sort

It can be applied to files of any size.

It requires more space than other sorting algorithm.

It is less efficient than other sorting algo.

Algorithm Best Case Average Case Worst Case Advantage(s) Disadvantage(s) Linear Search O(1)   O(n) O(n) It is very easy to understand and implement. It is an inefficient. Binary Search O(1) O(log n) O(logn) It is much faster than linear search.

It is more complicated than linear search.because ,It works only on lists that are sorted and kept sorted.

Bubble Sort O(n) O(n^2) O(n^2)

Easy to understand & implement.

In-place,No extra memory is needed.

It does not deal well with a list containing huge number of items. Insertion Sort O(n) O(n^2) O(n^2) It is simlpe and it also exhibits a good performance when dealing with a small list.

It does not perform as well as other ,better sorting algorithms.

It is useful ,only when sorting a list of few items.

Selection Sort O(n^2) O(n^2) O(n^2) It does not depend on initial arrangement of data. The comparisions required is o(n^2),thus it is appropriate only of small N.

Merge Sort

O(n log n) O(nlogn) O(nlogn)

It can be applied to files of any size.

It requires more space than other sorting algorithm.

It is less efficient than other sorting algo.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote