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


Please Help Members By Posting Answers For Below Questions

Does treemap allow null key?

549


What are threaded binary trees?

626


What is linear-logarithm chasm?

636


write a program to show the insertion and deletion of an element in an array using the position

572


What is worst case complexity algorithm?

571






Why is treeset sorted?

610


Why do we use stacks?

559


Explain the uses of b+ tree.

598


Which sorting algorithm is worst?

574


Explain the difference between hashset and hashmap?

642


What is the advantage of circular linked list?

477


Explain what are the major data structures used in the rdbms?

621


What is height balanced tree?

572


Draw the B-tree of order 3 created by inserting the following data arriving in sequence – 92 24 6 7 11 8 22 4 5 16 19 20 78

1225


Is pointer a variable?

575