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

Differentiate among cycle, path, and circuit?

1006


Write a recursive c function to calculate the height of a binary tree.

946


What is priority queue in data structure?

1110


How do you initialize an arraylist?

1031


What do you understand by stable sort?

933


Are dictionaries mutable?

904


Write the importance of hashing?

1073


What are the five examples of data?

1026


A lot of data structures related programs related to only trees and graphs, like the diameter of a tree, removing the loops in a graph etc.

1075


Is char array null terminated?

928


What are threaded binary trees?

997


Write a program to reverse a link list.

984


Describe linear probing with an example.

1039


Explain what are the methods available in storing sequential files ?

985


What should I learn first data structures or algorithms?

1058