1.

Consider the array {1,1,1,1,1}. Select the wrong option?(a) Iterative linear search can be used to search for the elements in the given array(b) Recursive linear search can be used to search for the elements in the given array(c) Recursive binary search can be used to search for the elements in the given array(d) No method is defined to search for an element in the given arrayI have been asked this question in a job interview.This intriguing question comes from Search an Element in an Array using Recursion topic in section Recursion of Data Structures & Algorithms II

Answer»

Right CHOICE is (d) No method is defined to search for an ELEMENT in the given array

Easy EXPLANATION - ITERATIVE linear search, RECURSIVE linear search and Recursive binary search can be applied to search for an element in the above given array.



Discussion

No Comment Found

Related InterviewSolutions