The element being searched for is not found in an array of
100 elements. What is the average number of comparisons
needed in a sequential search to determine that the element
is not there, if the elements are completely unordered?

Answer Posted / poonam

IN sequential search (average case =[1/2(best case)+(wrost case)])...its the formula to calculate the average case of sequential search ...
so best case is when we found the element in first comparison.
worst case is when we found element in 100 comparison.
average case is =1/2(1+100)
ans would be 50.5

Is This Answer Correct ?    11 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between tree and binary tree?

544


What is b tree in data structure?

479


Are hash tables ordered?

472


Define terminal nodes in a tree?

557


Can we add duplicate keys in a hashmap?

503






how to delete first node from singly linked list?

629


how to insert a new node in linked list where free node will be available?

563


What is a static structure?

463


If I try to add enum constants to a treeset, what sorting order will it use?

711


What is complete binary tree in data structure?

515


Is map a data structure?

485


What is a concurrenthashmap?

553


What is the difference between hashset and arraylist?

481


What are the applications of b-tree?

550


Which sorting is best and why?

494