Design Algorithms MCQ with Answers Set-1

This post contains a computer network related to 20 multiple-choice questions (DAA SET-1) that help you to go through the subject and prepare you for design algorithms related questions in a competitive exam.

DAA MCQ Test Series Set-1

  • Total Number of Questions: 20

  • Each question carries equal marks i.e 1

  • No Negative Marking

Page 1 of 2

1. Let P be an array containing n integers. Let t be the lowest upper bound on the number of comparisons of the array elements, required to find the minimum and maximum values in an arbitrary array of n elements. Which one of the following choices is correct?
A.
B.
C.
D.
2.

For parameters a and b, both of which are$ω(1),T(n)=T(n^{\frac{1}{a}})+1,and T(b)=1$

Then T(n) is

A.
B.
C.
D.
3. Consider the following three functions.

$ f_1=10^n $  $ f_2 = n ^{log n}$ $ f_3 = n^{\sqrt{n}} $

Which one of the following options arranges the functions in the increasing order of asymptotic growth rate?
A.
B.
C.
D.
4. The average number of key comparisons done in a successful sequential search in a list of length n is __________.
A.
B.
C.
D.
E.
5. What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size n?
A.
B.
C.
D.
6. The order of the binary search algorithm is _________.
A.
B.
C.
D.
E.
7. Consider the following array.

23, 32, 45, 69, 72, 73, 89, 97

Which algorithm out of the following options uses the least number of comparisons (among the array elements) to sort the above array in ascending order?
A.
B.
C.
D.
8. A binary tree T contains n distinct elements. Which is the time complexity of picking an element is T that is smaller than the maximum element in T?
A.
B.
C.
D.
9.

Consider the string abbccddeee. Each letter in the string must be assigned a binary code satisfying the following properties:

  1. For any two letters, the code assigned to one letter must not be a prefix of the code assigned to the other letter.
  2. For any two letters of the same frequency, the letter which occurs earlier in the dictionary order is assigned a code whose length is at most the length of the code assigned to the other letter.

Amount the set of all binary code assignments which satisfy the above two properties, what is the minimum length of the encoded string?

A.
B.
C.
D.
10. Consider the following recurrence relation.

$T(n) =\begin{Bmatrix}
T & & if n> 0 \\
& (n/2+T(2n+5)+7n) & \\
1 & & if n = 0
\end{Bmatrix}$

Which one of the following options is correct?
A.
B.
C.
D.

 

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments