Question
Merge sort is O(N log N) in which of the following cases? (Select all that apply.) Group of answer choices best case average case worse
Merge sort is O(N log N) in which of the following cases? (Select all that apply.)
Group of answer choices
best case
average case
worse case
Flag this Question
Question 21 pts
What is the Big-O behavior of the merge phase of merge sort? Recall that the merge phase interleaves the two sorted subarrays to produce one larger, sorted array.
Group of answer choices
O(1)
O(logN)
O(N)
O(NlogN)
Flag this Question
Question 31 pts
In merge sort, when the subarray size reaches a small enough threshold, it is a good idea to switch over to a different sorting algorithm to avoid incurring the overhead of recursion for small arrays. Which sorting algorithm should be used?
Group of answer choices
insertion sort
quicksort
selection sort
Shellsort
Flag this Question
Question 41 pts
Quicksort is O(N log N) in which of the following cases? (Select all that apply.)
Group of answer choices
best case
average case
worst case
Flag this Question
Question 51 pts
When choosing a pivot for quicksort, using the median value in the array is a good choice that will lead to an overall O(N log N) behavior for the sort.
Group of answer choices
True
False
Flag this Question
Question 61 pts
What is the Big-O behavior of the partitioning phase of quicksort? Recall that the partitioning places every array item except the pivot in one of two groups: smaller than pivot and larger than pivot.
Group of answer choices
O(1)
O(logN)
O(N)
O(NlogN)
Flag this Question
Question 71 pts
What is the best growth rate possible for any sorting algorithm that works by comparing items, in the average and worst cases?
Group of answer choices
O(log N)
O(N)
O(NlogN)
O(N2)
Flag this Question
Question 81 pts
Which iterator method(s) may throw a NoSuchElement exception? (Select all that apply.)
Group of answer choices
hasNext
next
remove
Flag this Question
Question 91 pts
Which Java interface requires derived classes to implement an iterator method?
Group of answer choices
Collection
Iterable
Iterator
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started