what is meant by binary search?

Answer Posted / kiran

Record split into 2 halfs

compare last value of 1st half and 1st value of 2nd half

ex
we have 100 numbers
if we give 58

1-50 51-100
1st half second half

it ill check the last value of 1st half it is 50 and 1st
value of 2nd half it is 51

so it ill omit 1st half contains 1-50

again 51-100 split in 2 halfs

51-75 75-100
1st half 2nd half


it ill check the last value of 1st half it is 75 and 1st
value of 2nd half it is 100

so it ill omit 2nd half contains 75-100

like that process ill continue upto we get desired element

plz correct if i m worng

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Have you used comp and comp-3 in your project? And how?

2003


How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

504


1.give the details about WHEN OTHER. 2. how many form are available in evaluate.

1605


What are the different rules of SORT operation?

689


I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?

1796






what is difference between cobol and cobol/400

21548


What is amode(24)?

678


What is cobol?

736


What is comp-1 and comp-2?

754


Write the code to count the sum of n natural numbers.

697


Write some characteristics of cobol as means of business language.

611


What happens when we move a comp-3 field to an edited (say z (9). Zz-)?

764


Can you please let me know the centre name of INS certification in Kolkata.

1708


what is the use of outrecord?

1765


How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

634