Data structures & Algorithms MCQ Set 7



1.       The help menus or user manuals are the part of ______________.
A.      Program
B.      Algorithm
C.      Internal Documentation
D.      External Documentation

2.       The main measure for efficiency algorithm are-
A.      Processor and Memory
B.      Complexity and Capacity
C.      Data and Space
D.      Time and space

3.       What does the algorithmic analysis count?
A.      The number of arithmetic and the operations that are required to run the program
B.      The number of lines required by the program
C.      The number of seconds required by the program to execute
D.      None of these

4.       Examples of O(1) algorithms are______________.
A.      Multiplying two numbers.
B.      assigning some value to a variable
C.      displaying some integer on console
D.      All of the above

5.       Examples of O(n2) algorithms are______________.
A.      Adding of two Matrices
B.      Initializing all elements of matrix by zero
C.      Both A and B
D.      Neither A nor B

6.       The complexity of three algorithms is given as: O(n), O(n2) and O(n3). Which should execute slowest for large value of n?
A.      O(n)
B.      O(n2)
C.      O(n3)
D.      All will execute in same time.

7.       There are four algorithms A1, A2, A3, A4 to solve the given problem with the order log(n), nlog(n), log(log(n))n/log(n), Which is the best algorithm.
A.      A1
B.      A2
C.      A3
D.      A4

8.       Express the formula (n-1)*(n-5) in terms of big Oh notation
A.      O(1)
B.      O(log n)
C.      O(n)
D.      O(n2)
E.        
9.       The time complexity of binary search is________.
A.      O(1)
B.      O(log n)
C.      O(n)
D.      O(n logn)

10.    The time complexity of linear search is________.
A.      O(1)
B.      O(log n)
C.      O(n)

D.      O(n logn)





Answers
1.d
2.d
3.a
4.d
5.c
6.
7.c
8.d
9.b
10.c

0 comments:

Back to TOP