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

How to reference all the elements in a one-dimension array?

1038


Explain the uses of matrix with an example?

768


Can we store null in arraylist?

648


How to find 3rd element from end in a linked list in one pass?

645


How does hashset work internally in java?

711


How do you sort an array in descending order?

674


What is the difference between a push and a pop?

725


How do you clear a stack?

694


What are the types of data structures?

786


What is a hash index?

635


What is a concurrenthashmap?

756


What is difference between hashset and linkedhashset?

780


Questions related to arrays, such as given a 2 integer array, find the common elements.

694


What is array in data structure with example?

672


What is adt in data structure?

679