Chapter 2 Data Design and Implementation Use the following possible answers for
ID: 3794141 • Letter: C
Question
Chapter 2 Data Design and Implementation Use the following possible answers for Exercises 32-36. b, o (logN) c, O(N) d. O(N logN) e. O(N N) 32. The order of sorting an array of Nitems using one of the better sorting algorithms such as Quicksort. 33. The order of sorting an array of Nitems using one of the slower sorting algorithms such as Selectionsort. 34. The order of an algorithm that decrements every element in a three-dimensional table of N rows. 35. The order of an algorithm that increments every element in a two-dimensional table of N rows. 36. The order of comparing three items.Explanation / Answer
32.
O(NlogN)
Randomly picking a pivot value (or shuffling the array prior to sorting)
can help avoid worst case scenarios such as a perfectly sorted array.
33.
O(N*N)
Even a perfectly sorted input requires scanning the entire array
34.
O(N*N*N)
35.
O(N)
because Shellsort with Hibbard's increments runs in O(N3/2) time.
36.
O(logN)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.