Data Structures And Algorithms Mcqs set 4
1.Sorting is not possible by using which of the following methods?
2. What is the type of the algorithm used in solving the 8 Queens problem?
(c)Branch and Bound
3. For 0/1 KNAPSACK problem, the algorithm takes ________ amount of time for memory table, and ______time to determine the optimal load, for N objects and W as the capacity of KNAPSACK.
(a) O(N+W), O(NW) (b) O(NW), O(N+W)
(c) O(N), O(NW) (d) O(NW), O(N)
4. Choose the correct answer for the following statements:
I. The theory of NP–completeness provides a method of obtaining a polynomial time for NPalgorithms.
II. All NP-complete problem are NP-Hard.
(a) I is FALSE and II is TRUE
(b) I is TRUE and II is FALSE
(c) Both are TRUE
(d) Both are FALSE
5. The Knapsack problem where the objective function is to minimize the profit is ______
(a) Greedy (b) Dynamic 0 / 1
(c) Back tracking (d) Branch & Bound 0/1
6. Consider the usual algorithm for determining whether a sequence of parentheses is balanced. What is the maximum number of parentheses that will appear on the stack AT ANY ONE TIME when the algorithm analyzes: (()(())(()))
(a) 1 (b) 2 (c) 3 (d) 4
7. In analysis of algorithm, approximate relationship between the size of the job and the amount of work required to do is expressed by using _________
(a) Central tendency
(b) Differential equation
(c) Order of execution (d) Order of magnitude
8. The Sorting method which is used for external sort is
(a) Bubble sort (b) Quick sort (c) Merge sort (d) Radix sort
9. Let there be an array of length ‘N’, and the selection sort algorithm is used to sort it, how many times a swap function is called to complete the execution?
(a) N log N times (b) log N times
(c) N2 times (d) N-1 times
10. The time complexity of the normal quick sort, randomized quick sort algorithms in the worst case is
(a) O(n2), O(n log n) (b) O(n2), O(n2)
(c) O(n log n), O(n2) (d) O(n log n), O(n log n)