Data Structure MCQ cdac

Jio
By -
0

 

1) The most pessimistic scenario happen in direct hunt calculation when …

ans:Item is the last component in the exhibit

explaination:

-------------

1.The normal case happens in the Linear Search Algorithm when the thing to be

looked is in some place center of the Array.

2.The best case happens in the Linear Search Algorithm when the thing to be

looked is in beginning of the Array.

3.The most pessimistic scenario happens in the Linear Search Algorithm when the thing to be

looked is in finish of the Array.

2) If the quantity of records to be arranged is little, then … … arranging can be

productive.

A. Combine

B. Store

C. Determination

D. Bubble

Ans : C

3) The intricacy of arranging calculation gauges the … … as a component of the

number n of things

to be sorter.

A. normal time

B. running time

C. normal case intricacy

D. case-intricacy

ans: B

4) Which of coming up next isn't a constraint of twofold hunt calculation?

A. should utilize an arranged cluster

B. necessity of arranged cluster is costly when a ton of inclusion and

cancellations are required

C. there should be an instrument to straightforwardly get to center component

D. twofold inquiry calculation isn't productive when the information components more than

1500.

ans:D

5) The Average case happens in straight pursuit calculation … … … .

A. at the point when thing is some place in the cluster

B. at the point when thing isn't the cluster by any means

C. at the point when thing is the last component in the exhibit

D. Thing is the last component in the exhibit or thing isn't there in any way

ANS:A

6) Binary hunt calculation can't be applied to …

A. arranged connected list

B. arranged paired trees

C. arranged direct cluster

D. pointer exhibit

ANS:A

7) Complexity of direct inquiry calculation is … … …

A. O(n)

B. O(logn)

C. O(n2)

D. O(n logn)

ANS:A

8) Sorting calculation can be described as … …

A. Basic calculation which require the request for n2 correlations with sort n things.

B. Complex calculations that require the O(nlog2n) correlations with sort

things.

C. Both of the abovementioned

D. Nothing from what was just mentioned

ANS:C

9) The intricacy of air pocket sort calculation is … ..

A. O(n)

B. O(logn)

C. O(n2)

D. O(n logn)

ANS:C

10) State True or False for interior arranging calculations.

I) Internal arranging are applied when the whole assortment if information to be arranged

is little sufficient that the arranging can occur inside principal memory.

ii) The time expected to peruse or compose is viewed as huge in

assessing the presentation of inward arranging.

A. I-True, ii-True

B. I-True, ii-False

C. I-False, ii-True

D. I-False, ii-False

ANS:B

11) The intricacy of consolidation sort calculation is … …

A. O(n)

B. O(logn)

C. O(n2)

D. O(n logn)

ANS:D

12) … … … . is placing a component in the fitting spot in an arranged rundown yields

a bigger arranged request list.

A. Inclusion

B. Extraction

C. Determination

D. Conveyance

ANS:A

13) … … … … request is the most ideal for cluster arranging calculation which sorts n

thing.

A. O(n logn)

B. O(n2)

C. O(n+logn)

D. O(logn)

ANS:C

14) … … … is revising sets of components which are messed up, until no such

matches remain.

A. Addition

B. Trade

C. Choice

D. Appropriation

ANS:B

15) … … … … is the strategy utilized via card sorter.

A. Radix sort

B. Addition

C. Stack

D. Speedy

ANS:A

16) Which of the accompanying arranging calculation is of separation and vanquish type?

A. Bubble sort

B. Addition sort

C. Combine sort

D. Choice sort

ANS:C

17) … … .. arranging calculation is oftentimes utilized when n is little where n is all out    number of components.

A. Load

B. Inclusion

C. Bubble

D. Fast

ANS:B

18) Which of the accompanying arranging calculation is of need line arranging type?

A. Bubble sort

B. Inclusion sort

C. Consolidate sort

D. Determination sort

AND:D

19) Which of coming up next isn't the expected condition for paired search

calculation?

A. The rundown should be arranged

B. There ought to be the immediate admittance to the center component in any sub list

C. There should be component to erase or potentially embed components in list.

D. Number qualities ought to just be available

ANS:C

20) Partition and trade sort is … … ..

A. fast sort

B. tree sort

C. load sort

D. bubble sort

ANS:A

21. What is repeat for most pessimistic scenario of QuickSort and what is the time

intricacy in Worst case?

A. Repeat is T(n) = T(n-2) + O(n) and time intricacy is O(n^2)

B. Repeat is T(n) = T(n-1) + O(n) and time intricacy is O(n^2)

C. Repeat is T(n) = 2T(n/2) + O(n) and time intricacy is O(nLogn)

D. Repeat is T(n) = T(n/10) + T(9n/10) + O(n) and time intricacy is

O(nLogn)

View Answer

Ans : B

Clarification: No clarification.

22. Which of coming up next is definitely not a steady arranging calculation?

A. Inclusion sort

B. Determination sort

C. Bubble sort

D. Consolidate sort

View Answer

Ans : B

Explanation:Selection sort is definitely not a steady arranging calculation.

23. What is an outer arranging calculation?

A. Calculation that utilizations tape or circle during the sort

B. Calculation that utilizes primary memory during the sort

C. Calculation that includes trading

D. Calculation that are considered 'set up'

View Answer

Ans : A

Clarification: As the name recommends, outer arranging calculation utilizes outside

memory like tape or plate.

24. On the off chance that the quantity of records to be arranged is little, … … arranging can be

productive.

A. Combine

B. Load

C. Determination

D. Bubble

View Answer

Ans : C

Explanation:Selection arranging can be proficient.

25.Suppose we make some O(n) memories calculation that tracks down middle of an unsorted exhibit.

Presently consider a QuickSort execution where we first find middle utilizing the

above calculation, then, at that point, utilize middle as turn. What will be the most pessimistic scenario time

intricacy of this adjusted QuickSort.

A. O(n^2 Logn)

B. O(n^2)

C. O(n Logn)

D. O(nLogn)

View Answer

Ans : D

Explanation:If we utilize middle as a turn component, then, at that point, the repeat for all

cases becomes T(n) = 2T(n/2) + O(n) The above repeat can tackled use

Ace Method. It falls on the off chance that 2 of expert strategy.

26. Which of coming up next is certainly not a set up arranging calculation?

A. Determination sort

B. Load sort

C. Fast sort

D. Combine sort

View Answer

Ans : D

Clarification: Merge sort is definitely not a set up arranging calculation.



27. What is the upside of air pocket sort over other arranging strategies?

A. It is quicker

B. Consumes less memory

C. Recognizes whether the information is as of now arranged

D. All of the referenced

View Answer

Ans : C

Clarification: Bubble sort is one of the least difficult arranging procedures and maybe

the main benefit it has over different procedures is that it can identify whether

the information is as of now arranged.




28.The intricacy of arranging calculation gauges the … … as an element of the

number n of things to be sorter.

A. normal time

B. running time

C. normal case intricacy

D. case-intricacy

View Answer

Ans : B

Explanation:The intricacy of arranging calculation estimates the running time as a

capacity of the number n of things to be sorter.



29. Assume we are arranging a variety of eight numbers utilizing quicksort, and we

have recently completed the main parceling with the exhibit seeming to be this:

 2 5 1 7 9 12 11 10

 Which articulation is right?

A. The turn could be either the 7 or the 9.

B. The turn could be the 7, however it isn't the 9

C. The turn isn't the 7, yet it very well may be the 9

D. Neither the 7 nor the 9 is the turn.

View Answer

Ans : A

Explanation:7 and 9 both are at their right situations (as in an arranged cluster).

Additionally, all components on left of 7 and 9 are more modest than 7 and 9 individually and on the right are more noteworthy than 7 and 9 separately.



30.Consider the circumstance in which task activity is expensive. Which of

the accompanying arranging calculation ought to be performed so the quantity of

task activities is limited overall?

A. Inclusion sort

B. Determination sort

C. Store sort

D. None

View Answer

Ans : B

Explanation: Selection sort.



31.Which of coming up next is certainly not a steady arranging calculation in its commonplace

execution.

A. Addition Sort

B. Combine Sort

C. Speedy Sort

D. Bubble Sort

ANS:C

32.Which of the accompanying arranging calculations in its normal execution gives

best execution when applied on a cluster which is arranged or practically arranged

(most extreme 1 or two components are lost).

A.Quick Sort

B.Heap Sort

C.Merge Sort

D.Insertion Sort

ANS:D

33.Given an unsorted cluster. The cluster has this property that each component in

cluster is all things considered k separation from its situation in arranged exhibit where k is a    positive whole number more modest than size of exhibit. Which arranging calculation can be    handily adjusted for arranging this cluster and what is the possible time

intricacy?

A.Insertion Sort with time intricacy O(kn)

B.Heap Sort with time intricacy O(nLogk)

C.Quick Sort with time intricacy O(kLogk)

D.Merge Sort with time intricacy O(kLogk)



ANS:B.Heap Sort with time intricacy O(nLogk)



34.Consider a circumstance where trade activity is expensive. Which of the

following arranging calculations ought to be favored so the quantity of trade

activities are limited overall?

A.Heap Sort

B.Selection Sort

C.Insertion Sort

D.Merge Sort

ANS:B



35.Which of coming up next isn't correct about examination based arranging calculations?

A.The least conceivable time intricacy of a correlation based arranging calculation

is O(nLogn) for an irregular information exhibit

 B.Any correlation-based arranging calculation can be made stable by involving position asa standards when two components are looked at 

C.Counting Sort isn't an examination based arranging algortihm

D.Heap Sort isn't a correlation based arranging calculation

ANS:D




36.Suppose we are arranging a variety of eight whole numbers utilizing quicksort, and we have quite recently completed the main dividing with the exhibit seeming to be this:

2 5 1 7 9 12 11 10

Which explanation is right?

A.The turn could be either the 7 or the 9.

B.The turn could be the 7, however it isn't the 9

C.The turn isn't the 7, however it very well may be the 9

D.Neither the 7 nor the 9 is the turn.



ANS:A




37.Suppose we are arranging a variety of eight whole numbers utilizing heapsort, and we have

just completed some heapify (either maxheapify or minheapify) tasks. The

exhibit presently seems to be this: 16 14 15 10 12 27 28 what number heapify activities have

been performed on base of store



37.Suppose we are arranging a variety of eight whole numbers utilizing heapsort, and we have

just completed some heapify (either maxheapify or minheapify) activities. The

cluster presently seems to be this: 16 14 15 10 12 27 28 what number heapify tasks have

been performed on base of store?

A.1

B.2

C.3 or 4

D.5 or 6




ANS:B

38.What is the best time intricacy of air pocket sort?

A.N^2

B.NlogN

C.N

D.N(logN)^2

ANS:C


39. You need to sort 1 GB of information with just 100 MB of accessible primary memory.

Which arranging procedure will be generally fitting?

A.Heap sort

B.Merge sort

C.Quick sort

D.Insertion sort

ANS:B



40.What is the most pessimistic scenario time intricacy of addition sort where position of

the information to be embedded is determined utilizing double inquiry?

A.N

B.NlogN

C.N^2

D.N(logN)^2

ANS:C

41.The most impenetrable lower bound on the quantity of correlations, in the most pessimistic scenario, for

examination based arranging is of the request for

A.N

B.N^2

C.NlogN

D.N(logN)^2

ANS:C



42.In a changed union sort, the information cluster is splitted at a position 33%

of the length(N) of the cluster. Which of coming up next is the most impenetrable upper

bound on time intricacy of this adjusted Merge Sort.

A.N(logN base 3)

B.N(logN base 2/3)

C.N(logN base 1/3)

D.N(logN base 3/2)

ANS:D

43.Which arranging calculation will take least time when all components of info exhibit are indistinguishable? Think about regular executions of arranging calculations.

A.Insertion Sort

B.Heap Sort

C.Merge Sort

D.Selection Sort

ANS:A

The inclusion sort will take \theta(n) time when info exhibit is arranged.

44.A rundown of n string, every one of length n, is arranged into lexicographic request

utilizing the consolidation sort calculation. The most pessimistic scenario running season of this calculation

is

A.O (n log n)

B.O (n2 log n)

C.O (n2 + log n)

D.O (n2)

ANS:B

 Clarification:

The repeat tree for consolidate sort will have level Log(n). Furthermore, O(n^2) work will

be finished at each level of the repeat tree (Each level includes n examinations

furthermore, an examination takes O(n) time in most pessimistic scenario). So time intricacy of this

Blend Sort will be O (n^2 log n) .




45.n speedy sort, for arranging n components, the (n/4)th littlest component is

chosen as turn utilizing an O(n) time calculation. What is the most pessimistic scenario time    intricacy of the fast sort? (A) \theta(n) (B) \theta(nLogn) (C) \theta(n^2)

(D) \theta(n^2 log n)

A.A

B.B

C.C

D.D


ANS:B

 Clarification:

The recursion articulation becomes: T(n) = T(n/4) + T(3n/4) + cn After settling the

above recursion, we get \theta(nLogn).


46. Consider the Quicksort calculation. Assume there is a methodology for viewing as a

turn component what parts the rundown into two sub-records every one of which contains at

least one-fifth of the components. Let T(n) be the number of examinations required

to sort n components. Then, at that point,

A.T(n) <= 2T(n/5) + n

B.T(n) <= T(n/5) + T(4n/5) + n

C.T(n) <= 2T(4n/5) + n

D.T(n) <= 2T(n/2) + n



ANS:B

 Clarification:

For the situation where n/5 components are in one subset, T(n/5) correlations are required

for the principal subset with n/5 components, T(4n/5) is for the rest 4n/5 components,

furthermore, n is for tracking down the turn. On the off chance that there are more than n/5 components in a single set

then other set will have under 4n/5 components and time intricacy will be

not exactly T(n/5) + T(4n/5) + n since recursion tree will be more adjusted



47.Which of the accompanying arranging calculations has the least most pessimistic scenario

intricacy?

A.Merge Sort

B.Bubble Sort

C.Quick Sort

D.Selection Sort

ANS:A

Clarification:

Most pessimistic scenario intricacies for the above arranging calculations are as per the following: Merge

Sort — nLogn Bubble Sort — n^2 Quick Sort — n^2 Selection Sort — n^2

48.Which arranging calculations is generally productive to sort string comprising of ASCII

characters?

A.Quick sort

B.Heap sort

C.Merge sort

D.Counting sort

ANS:D

Clarification:

Counting sort calculation is effective when scope of information to be arranged is fixed. In the above question, the reach is from 0 to 255(ASCII territory). Counting sort

utilizes an additional a consistent space corresponding to scope of information.



49.The number of components that can be arranged in \Theta(logn) time utilizing load

sort is

(A) \Theta(1)

(B) \Theta(\sqrt{logn})

(C) \Theta(Log n/(Log n))

(d) \Theta(Log n)

A.A

B.B

C.C

D.D

ANS:C



50.Which of coming up next is valid about combine sort?

A.Merge Sort works better compared to fast sort assuming the information is gotten to from slow

successive memory.

B.Merge Sort is steady sort ordinarily

C.Merge sort beats store sort in a large portion of the commonsense circumstances.

D.All of the abovementioned.

ANS:D




Post a Comment

0Comments

Post a Comment (0)