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 / nishant singh
Binary search is faster because we traverse the elements by
using the policy of Divide and Conquer.
we compare the key element with the approximately center
element, if it is smaller than it search is applied in the
smaller elements only otherwise the search is applied in the
larger set of elements.
its complexity is as we all know is log n as compared to the
sequential one whose complexity is n.
| Is This Answer Correct ? | 30 Yes | 1 No |
Post New Answer View All Answers
Define graph?
Why is tuple immutable?
What are the different binary tree traversal techniques?
in tree construction which is the suitable efficient data structure? (Array, linked list, stack, queue)
Define threaded binary tree. Explain its common uses
Explain binary searching and Fibinocci search?
Why would you use a linked list?
Can an arraylist be null?
What is sequential search?
Why do we need arrays if all the operations that are performed on arrays can be performed on arraylist?
What is a stable sort?
Can we insert null in list?
What is an acyclic graph?
Define the tree data structure.
What are the different types of sorting? Explain the difference between them.