What is recurrence for worst case of QuickSort and what is the time complexity in Worst case?
Suppose we have a O(n) time algorithm that finds median of an unsorted array. Now consider a QuickSort implementation where we first find median using the above algorithm, then use median as pivot. What will be the worst case time complexity of this modified QuickSort.
1 Crore+ students have signed up on EduRev. Have you? Download the App |
Which of the following sorting algorithms in its typical implementation gives best performance when applied on an array which is sorted or almost sorted (maximum 1 or two elements are misplaced).
Suppose we are sorting an array of eight integers using quicksort, and we have just finished the first partitioning with the array looking like this: 2 5 1 7 9 12 11 10 Which statement is correct?
Consider a situation where swap operation is very costly. Which of the following sorting algorithms should be preferred so that the number of swap operations are minimized in general?
Suppose we are sorting an array of eight integers using heapsort, and we have just finished some heapify (either maxheapify or minheapify) operations. The array now looks like this: 16 14 15 10 12 27 28 How many heapify operations have been performed on root of heap?
You have to sort 1 GB of data with only 100 MB of available main memory. Which sorting technique will be most appropriate?
Given 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?
Which of the following is not a stable sorting algorithm in its typical implementation.
Which of the following is not true about comparison based sorting algorithms?
What is the worst case time complexity of insertion sort where position of the data to be inserted is calculated using binary search?
The tightest lower bound on the number of comparisons, in the worst case, for comparison-based sorting is of the order of
In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?
Which sorting algorithm will take least time when all elements of input array are identical? Consider typical implementations of sorting algorithms.
A list of n string, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is
In quick sort, for sorting n elements, the (n/4)th smallest element is selected as pivot using an O(n) time algorithm. What is the worst case time complexity of the quick sort?
Consider the Quicksort algorithm. Suppose there is a procedure for finding a pivot element which splits the list into two sub-lists each of which contains at least one-fifth of the elements. Let T(n) be the number of comparisons required to sort n elements. Then
Which of the following sorting algorithms has the lowest worst-case complexity?
Which sorting algorithms is most efficient to sort string consisting of ASCII characters?
55 docs|215 tests
|
55 docs|215 tests
|