info@avatto.com
+91-9920808017
0. Consider the following algorithm for searching for a given number x in an unsorted array A[1 .......n] having n distinct values: 1. Choose an i uniformly at random from 1.. .n; 2. If A[i] = x then Stop else Goto 1; Assuming that x is present on A, what is the expected number of comparisons made by the algorithm before it terminates?
n
n - 1
2n
n/2
Your email address will not be published. Required fields are marked *
Report
Name
Email
Website
Save my name, email, and website in this browser for the next time I comment.
Comment
Login with Facebook
Login with Google
Forgot your password?
Lost your password? Please enter your email address. You will receive mail with link to set new password.
Back to login