I am given a sequential algorithm that does a routine search
on an unordered list. N = 20.
The probability that the value x does NOT appear in the list
is exactly 60%, and the probability that x DOES appear is 40%.
The 3 questions that I could not get were:

A) What is the avg number of element comparisons performed
when n = 20 and x does NOT appear in the List.
(my answer was 20, is this correct?)

B) What is the avg number of element comparisons peformed
when n = 20 and x DOES appear in the list?

C) What is the avg number of element comparisons performed
when n = 20. This should be a single number answer they said.

Answer Posted / bond

A) What is the avg number of element comparisons performed
when n = 20 and x does NOT appear in the List. (my answer
was 20, is this correct?)

è I guess 12.

B) What is the avg number of element comparisons peformed
when n = 20 and x DOES appear in the list?

è I guess 8.

C) What is the avg number of element comparisons performed
when n = 20. This should be a single number answer they
said.

è I guess 8.

Is This Answer Correct ?    5 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between array sort () and array sort t >()?

544


Define b-tree of order m?

654


Which is faster quick sort or merge sort?

559


What are data members?

611


Which interfaces are implemented by concurrentskiplistset?

573






What are the advantages of modularity?

586


Define an algorithm. What are the properties of an algorithm? What are the types of algorithms?

605


What is sorting explain?

581


Write a code for dynamic allocation of array.

663


Is hashmap a data structure?

608


What is stack in geography?

541


Write the importance of hashing?

684


In Data Structure, write output of given program.

579


Mention one advantage and disadvantage of using quadratic probing?

680


What is bubble insertion selection sort?

561