Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can we use binary search in internal table sorted in decending
order ? if no why?

Answer Posted / saksham gautam

Binary search algorithm is based on middle value , first
data is divided into two part on the basis of middle value
so that left side data is less than middle value and right
side data greater than middle value. Search value is equal
to middle value then it give result middle value. If search
value is greater than middle value it will be search right
side of middle value ,if search value is less than middle
value it will search left side. So Data should be ascending
order so that greater value will be right side of middle
value and lesser value will be left side of middle value.
For example 1,2,3,4,5,6,7,8,9 here middle value is 5.Now we
search 7 it will be search in right part from 5.It is give
result. It’s opposite if it is in descending order
9,8,7,6,5,4,3,2,1.Here 5 is middle value and 7 is searched
in right from 5 according to binary search algorithm ,it
will fail for the search.

Is This Answer Correct ?    17 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to call a subroutine in sapscript?

1060


What are the check tables?

1031


What is sap script? Describe its components.

1021


Explain what is the step-by-step process to create a table in data dictionary?

1078


What is a development class? : abap data dictionary

1166


Does sap handle multiple currencies?

957


Work most on which module: name a few tables?

991


Do we have to migrate all sapscript forms to smart forms?

1005


What is client in the sap system? : sap abap hr

1021


Explain the Types of Select statements?

1033


What will exactly the hide statement do?

977


Hi my dear friends,Please give the answers for the following link http://www.saptechnical.com/InterviewQ/interviewQ.htm

2094


Explain what are the problems in processing batch input sessions?

1007


Difference between sy-tabix and sy-index? Where it is used? Can you check sy-subarc after perform?

1013


What is the function module for INDIAN PAYROLL to read table cluster for given cluster table and sequence number?

2272