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 the height of binary tree?
What is difference between treeset hashset linkedhashset?
State the demerit of linear representation of binary trees?
Write an algorithm to show various operations on ordered list and arrays
What do you mean by selection sort?
What are the four characteristics of algorithms?
What is merge sort and how it works?
When ArrayIndexOutOfBoundsException occurs?
What is immutablelist?
How would you use bsearch() function to search a name stored in array of pointers to string?
How does selection sort work?
What is meant by strongly connected in a graph?
Explain what is linear search?
Why is sorting and classifying important?
What is the complexity of arrays sort?