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

Consider the basic implementations of sorting algorithms discussed in class and

ID: 3832912 • Letter: C

Question

Consider the basic implementations of sorting algorithms discussed in class and during lab. Circle true/false for each of the following statements below. Selection sort is always O(N^2). Quick sort is always O(N log_2N). Bubble sort O(N) in the best case. Heap sort uses a binary search tree to sort data. Merge sort uses more memory than quick sort. Merge sort O(N log_2N) in the best case. Bucket sort uses a linked list to store sorted data. Bucket sort is the fastest algorithm for sorting strings.

Explanation / Answer

Selection sort is always O(N^2) : True

Quick Sort always O(NlogN) : False
       Worst case of Quick Sort = O(N^2)

Bubble Sort O(N) is the best: True
       If array is already sorted then this is the best case

Heap Sort user more memory than quick sort: False
  
Merge Sort used more memory than Quick Sort: True

       Merge Sort uses O(N) extra memory

Bucket sort uses a linked list to store data: true

Bucket sort is the fastes algorithm for sorting strings: False
   Bucket sort is mainly useful when input is uniformly distributed over a range.

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