what is a binary search ? and how it is useful in a sorted
internal table?
Answer Posted / saplead.sai
The solution provided by Siddhart is though correct, I
would like to project the solution in a much detailed with
example.
Binary Search Basic rule - Sort the data in Ascending order.
Suppose we have random numbers ranging from 1 to 10000 and
we are searching for 4219. If the data is unorganized and
random....a sequential search would be time consuming.
Hence once the data is sorted in Ascending order. Binary
search would reduce the LOOKUP time.
In the FIRST PASS BINARY search would split the range of 1 -
10000 in to two halfs (i.e 1 - 4999 & 5000 - 10000) and
compares the 4219 which happens to fall in the first half.
In the next pass again two halfs are made and compared.
This way BINARY SEARCH works by dividing either data into
two halfs.
For internal table......or for anything else....this is it
| Is This Answer Correct ? | 15 Yes | 0 No |
Post New Answer View All Answers
What is an “on request field” statement?
What is native sql?
What are internal tables? How do you get the number of lines in an internal table? How to use a specific number occurs statement?
Example of table cluster and cluster tables.
How to write a code for multiple transactions? : abap bdc
Explain how data is stored in cluster table?
What are the relational operations that can be performed on view in sap? : abap data dictionary
Explain the components of selection table?
What is abap dictionary or data dictionary? What is the transaction to access abap dictionary? : abap data dictionary
What are the function modules that are generated when you activate a lockobject? : sap abap data dictionary
What are screen painter? Menu painter? Gui status?
Explain the disadvantages of logical databases?
How many secondary indexes can we create in a table?
Explain what is a foreign key relationship? Explain this with the help of an example.
What are control tables? : abap data dictionary