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...

Which one is faster?
A binary search of an orderd set of elements in an array
or
a sequential search of the elements.

Answer Posted / ujjwal dave

binary search is faster and more useful in case we need to
perform search a number of times, complexity of sequential
search will be n each time where in binary search will take
more time only at first time when data is not sorted once
the data is sorted......it will take only only log n
attempts to search each element.......so the decision also
depends on frequency of the data beign searched

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the height of binary tree?

924


What is difference between treeset hashset linkedhashset?

840


State the demerit of linear representation of binary trees?

877


Write an algorithm to show various operations on ordered list and arrays

881


What do you mean by selection sort?

839


What are the four characteristics of algorithms?

817


What is merge sort and how it works?

789


When ArrayIndexOutOfBoundsException occurs?

1063


What is immutablelist?

850


How would you use bsearch() function to search a name stored in array of pointers to string?

800


How does selection sort work?

845


What is meant by strongly connected in a graph?

869


Explain what is linear search?

924


Why is sorting and classifying important?

775


What is the complexity of arrays sort?

861