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


Please Help Members By Posting Answers For Below Questions

What are the buffering options in abap?

753


What is a persistent class?

1147


What are aggregated objects

734


What are the types of data types in the sap abap?

639


How to Modify Layout set for RVORDER01 for printing sales order confirmation. plz mention the detail coding Tahnks, Rahul

3617






What is the disadvantage of a call by reference? : abap modularization

803


Which function module would you use to check the user’s authorization to access files before opening a file?

801


What are datasets in abap?

860


Badi concepts

1125


Is it possible to pass data to and from include programs explicitly? : abap modularization

959


Where do you create indexes in abap?

828


What is the difference between a pool table and a transparent table and how they are stored at the database level?

788


Lock objects and what are parameters of ENQUEUE FM?

1450


Explain what are the system fields? Explain?

739


1.why dont use top of page. wat is the use? 2. wat is sub screen? 3. why u select the session method in bdc ? how many records wil be updated on that time? 4.why dont use start form in script? 5.wat is difference b/w dilldown and interactive report? 6. wat is pf status interactine report?

2573