Data Structures - Abstract Data Types

6:  

An algorithm is made up of 2 modules M1&M2. If order of M1 is f(n) & M2 is g(n) then the order of algorithm is?

A.

max (f(n),g(n))

B.

min (f(n),g(n))

C.

f(n) + g(n)

D.

f(n) X g(n)

 
 

Option: B

Explanation :

Click on Discuss to view users comments.

anonymous said: (11:55am on Wednesday 19th February 2014)
If order of M1 if quadratic and M2 is linear, overall order will be quadratic and not linear right? say F(n) = n^2 and g(n) = n, it should be max(n^2, n) = n^2

Write your comments here:



7:  

An array of n numbers is given, where n is an even number. The maximum as well as the minimum of these n numbers needs to be determined. Which of the following is TRUE about the number of comparisons needed?

A.

At least 2n-c comparisons, for some constant c, are needed.

B.

At most 1.5n-2 comparisons are needed.

C.

At least nlog2n comparisons are needed.

D.

None of the above.

 
 

Option: B

Explanation :

Click on Discuss to view users comments.

Aparna said: (11:08pm on Thursday 25th June 2015)
what would be the case if n is odd?

Write your comments here:



8:  

The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is

A.

Θ(n)

B.

Θ(logn)

C.

Θ(log*n)

D.

Θ(1)

 
 

Option: B

Explanation :

Since it is a sorted array, we can use binary search to identify the position of the first occurence of the given integer in (logn) steps. If at all this integer repeats, its appearance has to be continuous because the array is sorted.

Click on Discuss to view users comments.

Vishal_Gupta said: (9:59pm on Thursday 26th November 2015)
Since array is sorted so only two comparison are enough to know that an integer appears more than n/2 times correct option is D

Write your comments here:



Related MCQ


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