Design Algorithm Analysis GATE CS and IT previous year questions with Answer
Ques 21 Gate 2016 Set-2
Assume that the algorithms considered here sort the input sequences in ascending order. If the input is already in ascending order, which of the following are TRUE ?
I. Quicksort runs in Θ(n2) time
II. Bubblesort runs in Θ(n2) time
III. Mergesort runs in Θ(n) time
IV. Insertion sort runs in Θ(n) time
Ques 22 Gate 2016 Set-1
The worst case running times of Insertion sort, Merge sort and Quick sort, respectively, are:
Ques 23 Gate 2015 Set-2
Consider two decision problems Q1, Q2 such that Q1 reduces in polynomial time to 3-SAT and 3-SAT reduces in polynomial time to Q2. Then which one of the following is consistent with the above statement?
Ques 24 Gate 2015 Set-1
Which one of the following is the recurrence equation for the worst case time complexity of the Quicksort algorithm for sorting n ( ≥ 2) numbers? In the recurrence equations given in the options below, c is a constant.
Ques 25 Gate 2015 Set-1
Match the following
(P) Prim’s algorithm for minimum spanning tree | (i) Backtracking |
(Q) Floyd-Warshall algorithm for all pairs shortest paths | (ii) Greedy method |
(R) Mergesort | (iii) Dynamic programming |
(S) Hamiltonian circuit | (iv) Divide and conquer |
Ques 26 Gate 2014 Set-1
Let P be a QuickSort Program to sort numbers in ascending order using the first element as pivot. Let t1 and t2 be the number of comparisons made by P for the inputs [1, 2, 3, 4, 5] and [4, 1, 5, 3, 2] respectively. Which one of the following holds?