1.

What is the difference between binary search and sequential search in COBOL?

Answer»
Binary SearchSEQUENTIAL Search
In this, table element key values should be in an ASCENDING or descending order.In this, table element keys are not required to be in any order.
The table is “halved” or divided into two sections to search for the matching result.The table is searched from the top to bottom in a sequence until the matching result is found.
The better option for large tables, i.e. tables having more than 70 elements.The better option for small tables, i.e. tables with less than or equal to 70 elements.
SEARCH ALL syntax is used in Binary SEARCHESSEARCH syntax is used for sequential searches.


Discussion

No Comment Found