Skip to content

Tag Archives: Algorithms-Sorting-Quiz

In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. Which of the following is… Read More
The tightest lower bound on the number of comparisons, in the worst case, for comparison-based sorting is of the order of (A) N (B) N^2… Read More
What is the worst case time complexity of insertion sort where position of the data to be inserted is calculated using binary search? (A) N… Read More
You have to sort 1 GB of data with only 100 MB of available main memory. Which sorting technique will be most appropriate? (A) Heap… Read More
What is the best time complexity of bubble sort? (A) N^2 (B) NlogN (C) N (D) N(logN)^2 Answer: (C) Explanation: The bubble sort is at… Read More
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… Read More
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:… Read More
Which of the following is not true about comparison based sorting algorithms? (A) The minimum possible time complexity of a comparison based sorting algorithm is… Read More
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… Read More
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… Read More
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… Read More
Which of the following is not a stable sorting algorithm in its typical implementation. (A) Insertion Sort (B) Merge Sort (C) Quick Sort (D) Bubble… Read More
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… Read More
What is recurrence for worst case of QuickSort and what is the time complexity in Worst case? (A) Recurrence is T(n) = T(n-2) + O(n)… Read More

Start Your Coding Journey Now!