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
What is array and its types?
what is Singly Linked list?
Define avl tree?
How can you add an item to the beginning of the list?
Is bubble sort faster than selection sort?
Why would you use a linked list?
Will hashmap allow null keys?
What is the order of b tree?
Which is more efficient merge sort vs quicksort?
Why is arraylist used?
Parenthesis is never required in postfix or prefix expressions, why?
What do you mean by 2-3 tree?
What are the applications of graph data structure?
Differentiate between hashset and hashmap.
What is two-dimensional array?