what is the difference b/w linear search and binary search?
(how can these search)

Answer Posted / jeyachandran.p

Binary search is an efficient search compared to linear
search.Binary search requires sorted array while linear
search operates on unsorted array.

In binary search ,we looks through half of the list i.e
the element to be search is compared with mid value, if it
equals to mid value,search operation is over.otherwise if
the search element is smaller we have to search in the first
half of the list else we have to look in second half of the
list.

But linear search or sequential search requires an complete
search over the list.As far as ,Binary search is very best
in time and efficiency.It requires O[log n} times but linear
search requires O[n]times.

Is This Answer Correct ?    14 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I need the coding for BDC program to upload Purchase orders of known vendor (ME21) in Material Management

1782


How collect statement is different from append?

545


Explain the concept of clusters in payroll

2140


What is sap abap data classes?

622


Which transaction code can I use to analyze the performance of abap program?

574






What is generic buffering?

875


How will you define posting procedures?

921


how to create module pool program using table controls based on selection criteria specified for sales document item in the first screen and item details in the second screen. plz mention the detail coding Tahnks, Rahul

3425


What is the difference between dialog program and a report?

635


What is the master data necessary before you can start posting in MM?

848


Which transaction code can I used to analyze the performance of ABAP program.?

644


How do you process errors in session method ? : abap bdc

596


Lock objects and what are parameters of ENQUEUE FM?

1262


What is pretty printer?

607


What are the different abap editors? What is the used of different editors in abap?

583