Classical

Data Structures - Algorithms

6:  
The concept of order (Big O) is important because
 
A.

 it can be used to decide the best algorithm that solves a given problem

B.
it determines the maximum size of a problem that can be solved in a given system, in a given amount of time
C.

Both(a) and (b)

D.

none of the above

 
 

Option: C

Explanation :


7:  
The time complexity of an algorithm T(n), where n is the input size, is given by
T( n) = T( n - 1) + 1/n  if n > 1
The order of this algorithm is
 
A.

log n

B.

n

C.

n2

D.

nn

 
 

Option: A

Explanation :


8:  
A text is made up of the characters a, b, c, d, e each occurring with the probability .12, .4, .15, .08 and .25 respectively. The optimal coding technique will have the average length of
 
A.

2.15

B.

3.01

C.

2.3

D.

1.78

 
 

Option: A

Explanation :

Using Hoffman's algorithm, code for a is 1111; b is 0; c is 110; d is 1110; e is 10. Average code length is
4 x.12 + 1 x .4 + 3 x.15 + 4 x.08 + 2 x.25 = 2.15


9:  
The running time of an algorithm is given by
T(n) = T(n - 1) + T(n - 2) - T(n - 3), if n > 3
             n, otherwise.
 
A.

n

B.

log n

C.

nn

D.

n2

 
 

Option: A

Explanation :

Let us find what is T(4), T(5), T(6) is.
T( 4) = T(3) + T(2) - T(1) = 3 + 2 - 1 = 4
T(5) = T(4) + T(3) - T(2) = 4 + 3 - 2 = 5
T(6) = T(5) + T(4) - T(3) = 5 + 4 - 3 = 6
By induction it can be proved that T(n) = n. Hence order is n.


10:  
The order of an algorithm that finds whether a given Boolean function of 'n' variables, produces a 1 is
 
A.

constant

B.

 linear

C.

 logarithmic

D.

 exponential

 
 

Option: A

Explanation :

Let T(1) = T(2) = T(3) = k (say). Then T(4) = k + k - k = k
T(5) = k+ k- k= k.
By mathematical induction it can be proved that T(n) = k, a constant.




Suggest an improvement

 


Syllabus covered in this section is-

  • Abstract data types
  • Algorithms
  • Stacks, Queues
  • Linked Lists
  • Trees, Binary search trees
  • Binary heaps

This Section covers Data Structures Questions Answers using C language .
Who can benefit - 

  • Any student who is pursuing B.Sc. in Information Technology can also use this Data Structures mcq section. 
  • Data Structures MCQs can also be used by any student who is pursuing any undergraduate or postgraduate degree in Computer Science.
  • Any candidate who has to appear for DOEACC A, B or C level Exam can also use Data Structures Questions Answers to gain credits in their exams.
  • Candidates appearing for Kendriya Vidyalya Sangathan Entrance Exam can also use Data Structures Multiple Choice Questions Answers for the preparation of their exams.
  • Data Structures Questions Answers can also be used by MCA students for the preparation of their exams.
  • You can also get Data Structures mcq pdf if you purchase an e-book from site.
  • You can download Data Structures MCQ pdf from this site.
  • You can get access to Data Structures Multiple Choice Questions Answers  EBook.

Various Search Terms used for this section are

  • Data Structures quiz questions with answers

  • Data Structures exam questions answers

  • Data Structures MCQ questions Answers

  • Data Structures MCQ

  • Data Structure MCQ Pdf Download