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 are the tasks performed during preorder traversal?
How to reverse a singly linked list?
What is the use of data structure in real life?
What is difference between list and array?
In what areas do data structures are applied?
What are the advantages of merge sort?
How do you sort large data?
Briefly explain recursive algorithm 50 how do you search for a target key in a linked list?
List all data structures you would use for a memory management module.
How would you reverse the characters of an array?
Which is faster hashmap or hashtable?
How is heap sort implemented?
Tell me do array subscripts always start with zero?
What is the function of stack?
Can we add duplicate keys in a hashmap? What will happen if we attempt to add duplicate values?