0% found this document useful (0 votes)
45 views5 pages

DAA Bits

daa

Uploaded by

karunakar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views5 pages

DAA Bits

daa

Uploaded by

karunakar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

To main measures of the efficiency of an algorithm are [ ]


A) Time and space B)Data and space C)Processor and D)Complexity and
complexity memory capacity

2. Which of the following is a Divide and Conquer algorithm? [ ]


A)Bubble sort B) Merge sort C) Selection sort D) Heap sort

3. The worst-case time complexity of Quick sort is [ ]


A) O(n) B) O(1) C) O(log2n) D)

4. Which of the following problems can’t be solved using recursion? [ ]


A)factorial of a B)nth fibonacci C)length of a string D)Problems without
number number base case

5. Recurrence equation formed for the tower of hanoi problem is given by [ ]


A)t(n) = 2t(n-1)+n B)t(n) = 2t(n/2)+c C)t(n) = 2t(n-1)+c D)t(n) = 2t(n/2)+n

6. What is the best case time complexity of the binary search algorithm? [ ]

A) O(1) B) O(n) C) O(log2n) D) O(n^2)

7. Worst case is the worst case time complexity of Prim’s algorithm if adjacency matrix is [ ]
used?
A) O(log V) B) O(V2) C) O(E2) D) O(V log E)

8. Which of the following is false about the Kruskal’s algorithm? [ ]


A)It constructs MST B) It is a greedy C) It uses union-find D) It can accept
by selecting edges in algorithm data structure cycles in the MST
increasing order of
their weights

9. Kruskal’s Algorithm for finding the Minimum Spanning Tree of a graph is a kind of a [ ]

A) DP Problem B) Greedyalgorithm C) Adhoc Problem D) None of the


above

10. Which of the following methods can be used to solve the Knapsack problem? [ ]
A) Divide And B) Sorting C) Monte-Carlo D) Dynamic
Conquer Algorithm Algorithm Programming

1. Upper bound is denoted as _______ [ ]

A) Ω B)O C) Θ D) ω

2. Master’s theorem is used for? [ ]

A)solving B)solving iterative C)analysing loops D)calculating the time


recurrences relations complexity of any
code

3. What is the objective of tower of hanoi puzzle? [ ]

A) to move all disks B)to divide the disks C)to move all disks to D)to divide the disks
to some other rod by equally among the some other rod in equally among three
following rules three rods by random order rods in random order
following rules

4. What is the time complexity of the above recursive implementation of binary search? [ ]

A)O(n) B)O(2n) C)O(logn) D)O(n!)

5. Which of the following sorting algorithms is the fastest? [ ]

A)merge sort B)quick sort C)insertion sort D)shell sort

6. In greedy method which type of solution is generated [ ]

A) Optimal B) Best solution C) Worst solution D)All Solution


solution

7. Which of the following is/are property/properties of a dynamic programming problem? [ ]

A) Evolutionary B) Require More C) Greedy Approach D) Optimal


Approach Time Substructure And
Overlapping
Subproblems

8. Fractional knapsack problem is solved most efficiently by which of the following [ ]


algorithm?

A)Divide and B)Greedy Method C)invariant D)None of the above


Conquer termination

9. The output of Kruskal and Prims algorithm is ________________ [ ]

A) Maximum B) Minimum C) Both A and B D)None of the above


spanning tree spanning tree
10. Dynamic programming is used to find: [ ]

A) All Optimal B) One Solution Is C)No Optimal D) Partial Solution


Solution Is Generated Solution Is Generated Is Generated
Generated

11

An algorithm that invokes itself within the process is called ___.

12

What are the three steps involved in mergesort?

13

The time complexity of Merge Sort in the worst case is __________.

14

Binary Search uses the divide and conquer strategy by dividing the search space into __________ parts.

15

In the greedy approach to solving the Job Sequencing problem, jobs are sorted based on their __________ in
descending order.

16 Kruskal’s algorithm for finding the Minimum Cost Spanning Tree (MST) selects edges in the order of increasing
__________.

17 Prim's algorithm starts from a __________ vertex and grows the MST by repeatedly adding the minimum-
weight edge.

18 Dijkstra's algorithm is used to solve the Single Source Shortest Path problem for graphs with __________
weights.

19 Divide and Conquer is not typically used in classic Single Source Shortest Path problems because they often
rely on __________ or dynamic programming approaches.

20

The __________ problem can be solved using dynamic programming by filling out a table that represents the
maximum profit for different capacities.
11
An algorithm is __________
12 ___ is the method of expressing the lower bound of an algorithm’s running time.

13
In the divide and conquer approach, the problem is divided into __________ subproblems of the same type.
14
In Quick Sort, the pivot element is used to __________ the array into two parts.
15
Strassen's algorithm for matrix multiplication improves over the classical algorithm by using __________
recursive multiplications instead of eight.
16
In the Job Sequencing with Deadlines problem, each job has a __________ and a profit associated with it.
17
A spanning tree of a connected graph is a subgraph that connects all the vertices and has no __________.
18
Kruskal’s algorithm for finding the Minimum Cost Spanning Tree (MST) selects edges in the order of increasing
__________.
19
In the Single Source Shortest Path problem, the goal is to find the shortest path from a given __________ to all
other vertices in a graph.
20
In dynamic programming, the solutions to subproblems are stored in a __________ to avoid recomputation.

****

You might also like