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
Explain binary searching and Fibinocci search?
Will arraylist maintain insertion order?
What are linked lists used for?
Is a hashset ordered?
Differentiate between hashmap and hashtable.
What is 1d array?
What is difference between list and linked list?
What is data type and its types?
What is the method to find the complexity of an algorithm?
What is inplace sorting?
Why quicksort is faster than merge sort?
Differentiate between push and pop?
What is the difference between Array and Arraylist?
What is the logic to reverse the array?
What is the minimum number of queues that can be used to implement a priority queue?