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 do you know about different sorting algorithms?

525


How can I study data structures and algorithms?

517


Differentiate file structure from storage structure?

511


What is quick sort?

630


How do you find the space complexity of a bubble sort?

494






What are linear and non linear data structures?

482


Is pointer a variable in data structure?

522


Which interfaces are implemented by abstractsequentiallist?

512


What is the difference between classifying and sorting?

503


How to traverse data in a linked list in forward and backward direction, write the algorithm?

530


Define shortest path?

571


What is a bubble sort and how do you perform it?

655


Which sorting algorithm is considered the fastest?

595


What do you mean by disjoint set adt?

543


Describe the complexity of Binary search

547