ramana


{ City } hyderabad
< Country > india
* Profession * sse
User No # 62223
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 2
Users Marked my Answers as Wrong # 1
Questions / { ramana }
Questions Answers Category Views Company eMail




Answers / { ramana }

Question { IBM, 31953 }

What is the difference between SEARCH and SEARCH ALL? What
is more efficient?


Answer

most of the pionts are covered so far, I would like to add
one more point here,

In search all to get expected results array must be in a
specified order, but search all also works for an unsorted
array but may or may not give the expected results as it
keeps on divide.

Ex1: searching for 10. ** Array is not in order**

40
30
34
70
10
90

Iteration 1: it selects the second half 70,10,90
Iteration 2: It selects 10 n says the value is found.

Ex2: searching for te same 10.

40
10
34
70
30
90

Its follows the same process as in 1st case, but here 10 is
not there in the second iteration so it says value not
found, but it is present in the first half, this happens
because aray is not sorted.

Is This Answer Correct ?    2 Yes 1 No