Cobol Question:
Download Questions PDF

What is the difference between a binary search and a sequential search what are the pertinent COBOL?

Answer:

In a binary search, the table element key values must be in ascending or descending sequence. The table is ‘halved’ to search for equal to, greater than or less than conditions until the element is found. In a sequential search, the table is searched from top to bottom, so (ironically) the elements do not have to be in a specific sequence. The binary search is much faster for larger tables, while sequential works well with smaller ones. SEARCH ALL is used for binary searches; SEARCH for sequential.

Download Cobol Interview Questions And Answers PDF

Previous QuestionNext Question
Why do we code S9 (4) comp. Inspite of knowing comp-3 will occupy less space?What is the default value(s) for an INITIALIZE? What keyword will allow for an override of the default?