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
How do you sort an arraylist in descending order?
Can arraylist hold different types?
How do you do a mergesort?
How many sorting are there in data structure?
How do I push an element into a stack?
Which is the slowest sorting algorithm?
Can we use any class as map key?
Which sorting algorithm is worst?
What is difference between data type and data structure?
Does treemap allow null keys?
What are the 3 types of measurement?
Should I use hashmap or hashtable?
Define linked lists?
What is queue in data structure?
What are hash tables good for?