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
Define left-in threaded tree?
What are threaded binary trees?
How will you reverse Linked List.
What is the order of selection sort?
Which is better hashmap or hashtable?
How do you solve a selection sort?
What is the difference between hashmap and arraylist?
Does concat mutate array?
Why is quicksort unstable?
How do I start preparing for placement?
Describe linear probing with an example.
In what data structures are pointers applied?
Write a program to sum values of given array.
How does the bubble sort work?
Can you make an arraylist of arrays?