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
What is heap tree?
What are the parts of a linked list?
Which interfaces are implemented by abstractqueue?
What is a data structure? What are the types of data structures?
What is meant by a dynamic array?
How is bubble sort done?
What is the complexity of adding an element to the heap?
What is a node in it?
How is hashmap o 1?
Which file contains the definition of member functions?
What is a multiset table?
Write the procedure to convert general tree to binary tree?
How to find if linked list has loop?
Describe what is Node in link list? And name the types of Linked Lists?
What method is used to place a value onto the top of a stack?