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
What is data structures in computer science?
What is pointer in data structure?
Why we need cursor implementation of linked lists?
What is an iterative algorithm?
What happens when arraylist is full?
What is binary tree in computer science?
What is the order of selection sort?
Differentiate between singly and doubly linked lists?
What are the disadvantages of linear list?
Mention a few applications of linked lists?
Define biconnectivity?
Define forest?
Why do we use linked lists?
How do you find the complexity of a bubble sort?
What are the advantages and disadvantages of linked list over array?