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
How many types of searching are there in data structure?
Is duplicate allowed in hashmap?
What are linked lists good for?
What is stable sorting method?
What is the similarity between a Structure, Union and enumeration?
Which time complexity is best?
Define splay tree?
State the properties of b tree.
How to sort 1 million floating point numbers?
How can we remove loops in a linked list? What are the functions of fast and slow pointers?
Is quicksort divide and conquer?
Explain pre-order and in-order tree traversal.
What do you mean by separate chaining?
Explain binary searching and Fibinocci search?
What is int data type?