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 / p.divya poojitha
binary search is faster than sequential searching.in
sequential searching the desired record is 4000 if u search
that record can be done with 1....4000 so it takes large
time for searching compare complexities of both searching
meathods are
binary search O(logn)
sequential search O(n)
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can arraylist shrink?
What is array traversing?
What is the difference between binary tree and binary search tree?
What is the difference between hashset and linkedhashset?
How does a treemap work?
What are the best data structure courses for gate preparation?
Can we use any class as map key?
Give one example of right rotation.
Which language is best for data structures?
How would you use qsort() function to sort the name stored in an array of pointers to string?
How do you sort an arraylist in descending order?
Write code for reversing a linked list.
Which is better hashmap or hashtable?
What do you mean by priority queue?
If you are using c language to implement the heterogeneous linked list, explain what pointer type will you use?