What is binary search?

Answer Posted / sachin

Prefer when the table size is significantly large.

When the size of the table is large and it is arranged in
some sequence -either ascending or descending on search
field, then BINARY SEARCH would be the efficient method.

Table should be in sorted order of the searching argument.
There should be ASCENDING/DESCENDING Clause.
Index need not be set to 1 before SEARCH ALL.

Compare the item to be searched with the item at the
center. If it matches fine, else repeat the process with
the left or right half depending on where the item lies.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program that uses move corresponding.

668


I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

1223


how to move the records from file to array table. give with code example

2212


What are literals?

622


Which division and paragraphs are mandatory for a COBOL program?

705






How to use the same COBOL program in Batch and CICS on lines? explain with an example

1910


what is amode(24), amode(31), rmode(24) and rmode(any)?

688


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?

2091


How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?

699


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17024


How do define dynamic array in cobol.

665


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

1948


What type of SDLC u followed? Why?

1514


What is comp-1 and comp-2?

754


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

634