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 / ahan

The binary search is faster than the sequential search.The
complexity of binary search is 'log n' where as the
complexity of sequential search is 'n'.Since each time we
are proceeding we have to deal with only half of the
elements of the array than the previous one.So we can easily
get a number from an array of elements through binary search
than sequential search.

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is hashmap faster than arraylist?

844


What is the difference between hashmap and linkedhashmap?

857


What are the drawbacks of array implementation of queue?

1069


an array t[100] which contains numbers between 1..99. Return the duplicated value. Try both O(n) and O(n-square).

863


Explain the priority queue?

912


Explain different methods in which you can traverse a tree?

854


How will you check the validity of an expression containing nested parentheses?

878


Why is arraylist faster than linkedlist?

889


Why quicksort is better than merge sort?

861


Why do we use arrays?

863


If you are using c language to implement the heterogeneous linked list, explain what pointer type will you use?

948


How would you implement two stacks using a single array?

928


Why null is allowed in hashmap?

820


Name some applications which use linked lists.

940


What is meant by deque?

857