If the given input array is sorted or nearly sorted, which of the following algorithm gives the best performance?
a) Insertion sort b) Selection sort c) Quick sort d) Merge sort
a) Insertion sort b) Selection sort c) Quick sort d) Merge sort
a) O(logn) b) O(n) c) O(nlogn) d) O(n2)
a) Counting sort b) Bucket sort c) Radix sort d) Shell sort
a) θ (n2) b) θ (nlogn) c) θ (n1.5) d) θ (n)
a) O(n) b) O(nlogn) c) O(n2) d) None
a) Selection sort b) Heap sort c) Quick sort d) Merge sort
a) Merge sort b) Typical in-place quick sort c) Heap sort d) Selection sort
a) Insertion sort b) Selection sort c) Bubble sort d) Merge sort
a) Faced down b) Faced up c) It doesn’t matter d) Both sides are burnt
a) 1 and 3 b) 3 and 1 c) 2 and 6 d) 6 and 2
a) O(nlogn) b) O(logn) c) O(n) d) O(n2)
a) O(m) b) O(n) c) O(m+n) d) O(logm + logn)
a) It is faster b) Consumes less memory c) Detects whether the input is already sorted d) All of the mentioned
a) 0 or 1 b) 2 or 3 c) 4 or 5 d) 6 or 7
a) Shell sort b) Heap sort c) Merge-sort d) Quick sort
a) log n b) O(log n) c) n logn d) O(n log n)