1.
2.
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
3.
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
4.
5.

Which of the following sorting algorithms has the lowest worst-case complexity?
6.
7.

What is the time complexity of Floyd–Warshall algorithm to calculate all pair shortest path in a graph with n vertices?"
8.
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
9.
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? (A) \theta(n) (B) \theta(nLogn) (C) \theta(n^2) (D) \theta(n^2 log n)
10.
In a competition, four different functions are observed. All the functions use a single for loop and within the for loop, same set of statements are executed. Consider the following for loops:
A) for(i = 0; i < n; i++)
B) for(i = 0; i < n; i += 2)
C) for(i = 1; i < n; i *= 2)
D) for(i = n; i > -1; i /= 2)
Run on IDE
If n is the size of input(positive), which function is most efficient(if the task to be performed is not an issue)?