Example HTML page

DS – mcq on Searching

26.Binary search is useful when there are large number of_______in array.

  1. Arguments
  2. values
  3. Elements
  4. all the above

Answer: C

27.In binary search, we compare the value with the elements in the __________ position of the array.

  1. right
  2. Left
  3. Random
  4. middle

Answer: D

28.Which of the following is not the required condition for binary search algorithm?

  1. A.The list must be sorted
  2. There should be the direct access to the middle element in any sub list
  3. There must be mechanism to delete and/or insert elements in list.
  4. Number values should only be present

Answer: C

29.Finding the location of the element with a given value is ___.

  1. Traversal
  2. Search
  3. Sort
  4. None of above

Answer: B

30. How many comparisons are needed for linear Search array when elements are in order in best case?

  1. 1
  2. n
  3. n+1
  4. n-1

Answer:  A

31. In linear search Time complexity in best case for a successful search is___.

  1. 1
  2. n
  3. n+1/2
  4. n -1

 Answer:  A

32. In linear search Time complexity in average case for a successful search is___.

  1. 1
  2. n
  3. n+1/2
  4. n -1

 Answer:   C

33.In linear search Time complexity in average case for a Unsuccessful search is__.

  1. 1
  2. n
  3. n+1/2
  4. n -1

Answer: B

34.In linear search with list Time complexity in average case for a Unsuccessful search is

  1. A.1
  2. n
  3. n+1/2
  4. n -1

Answer: C

35.In linear search with list Time complexity in worst case for a Unsuccessful search is

  1. 1
  2. n
  3. n+1/2
  4. n -1

Answer: B

36.In Binary search time complexity in best case for a successful search is __

  1. 1
  2. Log2N
  3. log n+1
  4. N log N

Answer: A

37.In Binary search time complexity in worst case for a successful search is __

  1. 1
  2. Log2N
  3. log n+1
  4. N log N

Answer: B

38.In Binary search time complexity in average case for a successful search is __

  1. 1
  2. Log2N
  3. log n+1
  4. N log N

Answer: B

39.In Binary search time complexity in average case for a Unsuccessful search is __

  1. 1
  2. Log2N
  3. log n+1
  4. N log N

Answer: B

40.In Binary search time complexity in a best case for a Unsuccessful search is __

  1. 1
  2. Log2N
  3. log n+1
  4. N log N

Answer: B

41.In Binary search time complexity in worst case for a Unsuccessful search is __

  1. 1
  2. Log2N
  3. log n+1
  4. N log N

Answer: B

42.Non linear searching techniques are classified in to __ categories

  1. 1
  2. 3
  3. 2
  4. 4

Answer: C

43.The number of comparisons for the Binary Tree Search in best case is __

  1. 1
  2. n+1
  3. n-1
  4. n+1/2

Answer: A

44.The number of comparisons for the Binary Tree Search in average case is __

  1. 1
  2. n+1
  3. n
  4. n+1/2

Answer: C

45.The number of comparisons for the Binary Tree Search in worst case is __

  1. 1
  2. n+1
  3. n
  4. n+1/2

Answer: D

46.____ case does not exist in complexity theory

  1. Null
  2. Best
  3. Average
  4. worst

Answer: A

47.The worst case occur in linear search algorithm when item is __

  1. Somewhere in the middle of the array
  2. Not in the array at all.
  3. The last element in the array
  4. The last element in the array or is not there at all.

Answer: D

 

 

 

Example HTML page

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest