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 / pankaj

(sum of all 1 to 100) - (sum of given numbers)= number missing
for this no comparison required

Is This Answer Correct ?    4 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by breadth first search (bfs)?

614


Which is better merge sort or quick sort?

471


What is a string array?

506


State the properties of b tree.

520


How many parts are there in a declaration statement using data structures?

477






Does stringutils isempty check for null?

429


What is meant by int?

524


What is data structure what is need of it?

480


State the difference between primitive and non-primitive data types?

675


Why it is important to have aligned addresses? What is the exception generated when there is a misaligned address?

502


Define right-in threaded tree?

552


Is selection sort greedy?

510


How can you insert a node to the beginning of a singly linked list?

507


What are arrays give example?

496


what is the difference between singly and doubly linked lists?

537