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

Can you print decimals in type n?

757


Define subtype ? : abap hr

773


Explain some essential objects in abap dictionary?

919


What is the use of 'table index'?

841


How can we create callable modules of program code within one abap/4 program? : abap modularization

773


Explain Singleton class

1037


what is a text table ?

2104


What is page window?

745


What are control tables? : abap data dictionary

768


What is the difference between select statement and provide statement ? : abap hr

802


How can you display frames (horizontal and vertical lines) in lists?

815


How to give programe name as input in BDC report of abap ?

1986


What are the requirements a dialog program must fulfill?

839


What are the fields in a bdc_tab table? : abap bdc

799


How will you link form with the event driven in sap scripts?

734