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
What is the difference between array sort () and array sort t >()?
Define b-tree of order m?
Which is faster quick sort or merge sort?
What are data members?
Which interfaces are implemented by concurrentskiplistset?
What are the advantages of modularity?
Define an algorithm. What are the properties of an algorithm? What are the types of algorithms?
What is sorting explain?
Write a code for dynamic allocation of array.
Is hashmap a data structure?
What is stack in geography?
Write the importance of hashing?
In Data Structure, write output of given program.
Mention one advantage and disadvantage of using quadratic probing?
What is bubble insertion selection sort?