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
How to compare Two Arrays?
What is linked list with example?
what are the applications that use Linked lists?
What is 1d array?
Define threaded binary tree. Explain its common uses
What is a circular singly linked list?
What are the types of linked list?
What is unmodifiable list?
Explain pre-order and in-order tree traversal.
In tree construction which is the suitable efficient data structure?
What is sorting and classifying?
What do you mean by open addressing?
Which sorting algorithm is considered the fastest?
How many types of lists are there?
Is arraylist reference type?