Back to the 2024 paper
Similar questions
Design & Analysis of AlgorithmsThe worst case running times of Insertion sort, Merge sort and Quick sort, respectively, are: - (i) \Theta(n \log n), \Theta(n \log n) and \Theta(n^2) - (ii) \Theta(n^2), \Theta(n^2) and \Theta(n \log n) - (iii) \Theta(n^2), \Theta(n \log n) and \Theta(n \log n) - (iv) \Theta(n^2), \Theta(n \log n) and \Theta(n^2)20242mDesign and Analysis of Algorithms Which sorting algorithm is considered stable and has a time complexity of O(n^2)? (i) Quick sort (ii) Merge sort (iii) Insertion sort (iv) Selection sort20232mDesign & Analysis of AlgorithmsWhat is heap sort? What is the effect of calling MAX-HEAPIFY(A, i) when the element A[i] is larger than its children?20227mDesign & Analysis of AlgorithmsGiven an unsorted array. The array has this property that every element in array is at most k distance from its position in sorted array where k is a positive integer smaller than size of array. Which sorting algorithm can be easily modified for sorting this array and what is the obtainable time complexity? - (i) Insertion sort with time complexity O(kn) - (ii) Heap sort with time complexity O(n \log k) - (iii) Quick sort with time complexity O(k \log k) - (iv) Merge sort with time complexity O(k \log k)20222m
PreviousAssume that the algorithms considered here sort the input sequences in ascending order. If the input is already in ascending order, which of the following is TRUE? I. Quicksort runs in \Theta(n^2) time II. Bubblesort runs in \Theta(n^2) time III. Mergesort runs in \Theta(n) time IV. Insertion sort runs in \Theta(n) time - (i) I and II only - (ii) I and III only - (iii) II and IV only - (iv) I and IV onlyNextThe worst case running times of Insertion sort, Merge sort and Quick sort, respectively, are: - (i) \Theta(n \log n), \Theta(n \log n) and \Theta(n^2) - (ii) \Theta(n^2), \Theta(n^2) and \Theta(n \log n) - (iii) \Theta(n^2), \Theta(n \log n) and \Theta(n \log n) - (iv) \Theta(n^2), \Theta(n \log n) and \Theta(n^2)