# DS – mcq on Searching

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

- Arguments
- values
- Elements
- all the above

Answer: C

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

- right
- Left
- Random
- middle

Answer: D

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

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

Answer: C

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

- Traversal
- Search
- Sort
- None of above

Answer: B

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

- 1
- n
- n+1
- n-1

Answer: A

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

- 1
- n
- n+1/2
- n -1

Answer: A

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

- 1
- n
- n+1/2
- n -1

Answer: C

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

- 1
- n
- n+1/2
- n -1

Answer: B

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

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

Answer: C

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

- 1
- n
- n+1/2
- n -1

Answer: B

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

- 1
- Log
_{2}N - log n+1
- N log N

Answer: A

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

- 1
- Log
_{2}N - log n+1
- N log N

Answer: B

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

- 1
- Log
_{2}N - log n+1
- N log N

Answer: B

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

- 1
- Log
_{2}N - log n+1
- N log N

Answer: B

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

- 1
- Log
_{2}N - log n+1
- N log N

Answer: B

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

- 1
- Log
_{2}N - log n+1
- N log N

Answer: B

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

- 1
- 3
- 2
- 4

Answer: C

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

- 1
- n+1
- n-1
- n+1/2

Answer: A

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

- 1
- n+1
- n
- n+1/2

Answer: C

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

- 1
- n+1
- n
- n+1/2

Answer: D

46.____ case does not exist in complexity theory

- Null
- Best
- Average
- worst

Answer: A

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

- Somewhere in the middle of the array
- Not in the array at all.
- The last element in the array
- The last element in the array or is not there at all.

Answer: D