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

Will hashmap allow null keys?

506


Explain the uses of binary tree.

497


What is meant by int?

526


Which is better array or linked list?

490


What do you mean by collision in hashing?

564






Which sorting algorithm is used in collections sort?

433


How to sort an Array?

588


What are all the classes and interfaces that are available in the collections?

503


Now you are given an array of a characters (both ASCII and Kanji) and, an index into the array. The index points to the start of some character. Now you need to write a function to do a backspace (i.e. delete the character before the given index).

548


Can arraylist contain duplicates?

500


Can arraylist have duplicates?

525


Write program for Quick sort ?

600


What is difference between list and array list?

476


Explain different methods in which you can traverse a tree?

530


Explain the internal working of a hash map?

511