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
write an algorithm to show the procedure of insertion into a b-tree?
Which collection is used for sort?
What is frozenset?
What is array define its types?
What are the average and worst time complexity in a sorted binary tree is
What are the classification of data structures?
Is int a data structure?
How do I use quick sort?
What is the use of treemap?
What is treemap chart?
Where will be the free node available while inserting a new node in a linked list?
List some applications of queue data structure.
What is collection sort?
Why using cookie to store session info is a better idea than just using session info in the request?
Define forest?