what is meant by binary search?

Answer Posted / sumankumar

IT MEANS DATA SPLIT INTO 2 HALFS AND COMPARE FIRST HALF LAST
VALUE AND SECOND HALF FIRST VALUE WITH GIVEN DATA THEN
ELIMINATE HALF OF THE DATA AND AGAIN SPLIT INTO NEXT 2 HALFS
THIS PROCCESS WILL BE CONTINUED STILL VALUE IS IDENTIFIED

LET ME KNOW ONE EX:
PROGRAM: CONSIDER 1,2,3,4,5,6,7,8,9,10.
SET I TO 2
SEARCH ALL DATA
AT END DISPLY " EOT"
WHEN DATA(I)= 4
END-SEARCH ALL

SOL: THE DATA DIVIDE INTO 2 HALFS 1 TO 4, 5 TO 10 U R
REQUIREMENT IS SERCH AT POSITION OF 4 SO IT COMPARE FIRST
HALFS OF LAST VALUE i'e 4 AND SECOND HALFS OF FIRST VALUE
i'e 5 AND ELIMINATE THE HALF OF DATA AND AGAIN SPLIT IT INTO
NEXET 2 HALFS THIS PROCCESS WILL BE CONTINUED STILL VALUE IS
IDENTIFIED

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different rules to perform a Search?

702


what is search and searchall?what is the diffrence between them?give an best example?

5875


how do you define single dimensional array and multidimensional array in your cobol?

767


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

729


How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?

2215






What is redefines clause in COBOL?

927


What kind of error is trapped by on size error option?

832


Which mode is used to operate the sequential file?

800


Why occurs cannot be used in 01 level in COBOL?

809


What are the different rules for performing sort operation?

851


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

1814


i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

982


What is the difference between Global and External Variables?

768


How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

834


What are the rules of the move verb?

813