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
Differentiate among cycle, path, and circuit?
Write a recursive c function to calculate the height of a binary tree.
What is priority queue in data structure?
How do you initialize an arraylist?
What do you understand by stable sort?
Are dictionaries mutable?
Write the importance of hashing?
What are the five examples of data?
A lot of data structures related programs related to only trees and graphs, like the diameter of a tree, removing the loops in a graph etc.
Is char array null terminated?
What are threaded binary trees?
Write a program to reverse a link list.
Describe linear probing with an example.
Explain what are the methods available in storing sequential files ?
What should I learn first data structures or algorithms?