1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lawyer [7]
3 years ago
10

Using Sequential Search on an array of size n, the search key is definitely present in the array. The probability of matching th

e key to the nth item in the array is 1/3, and the probability of matching the key to the (n-1)st item is 1/2. The probabilities of matching each of the remaining items are all equal. What is the average case complexity function for Sequential Search under these conditions?
Computers and Technology
1 answer:
MissTica3 years ago
7 0

Answer:

(11n-5) / 12 is correct answer.

Explanation:

The Probability that key will match to nth term = 1/2

The Probability that key will match to n-1th term = 1/3

As all other probabilities are equal

The Total Probability that key matches to any of 1 to n-2 index = 1 - 1/2 - 1/3 = 1/6

The Probability that key matches to any of 1 to n-2 index = (1/6) / n-2 = (1/6)* (n-2))

Let P(i) = Probability that key matches to ith index.

The Average time complexity = 22 i=1 P(i) * i

The Average time complexity = 1/(6(n-2) * ( sum of 1 to n-2 ) + (n-1) / 3 + n/2

The Average time complexity = 1/(6(n-2) * ( n-2)*(n-1) / 2 + ( n-1) / 3 + n/2

The Average time complexity = 1/6 * (n-1)/2 + (n-1)/3 + n/2

The Average time complexity = (n-1)/12 + (n-1)/3 + n/2

The Average time complexity = (n-1 + 4 * n - 4 * 1 +6 * n)/12

The Average time complexity = 11n-5 / 12

so (11n-5) / 12 is correct answer.

You might be interested in
Power point how to insert diamond symbol
IceJOKER [234]
You got to "insert" and then you go to "shapes" and then you find the symbol you like and you drag and drop it onto the page. Then you can resize to the size and angle you would like it at.
4 0
3 years ago
Help me with this please
Ymorist [56]

Answer:

q1 chees

q2 web and digital continant

Explanation:

because haaa haaa haa dhum

7 0
2 years ago
What is seven times seven divided by 49
Travka [436]

The answer is really simple. 7 x 7 = 49. 49/49 is 1. I hope this helps

6 0
3 years ago
Read 2 more answers
NEED HELP 100 POINTS FOR ANSWER AND BRAINIEST!!! Which comparison operator is used to signify that a value is not equal to anoth
katrin2010 [14]

Answer:

We use SQL Not Equal comparison operator (<>) to compare two expressions. For example, 10<>11 comparison operation uses SQL Not Equal operator (<>) between two expressions 10 and 11

Explanation:

8 0
3 years ago
Read 2 more answers
When do we use an if- statement ​
wel

Answer:

You'd use an if statement if something happens. What I mean is that {If this happens} Then that happens but if the if doesnt happen then the then doesnt happen

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Do most facebook and twitter users access the platform from their personal computers?
    6·2 answers
  • The issue with discovering a perfect solution to a problem is that ________.
    10·2 answers
  • What are the cause of eye strain during computer usage?
    7·1 answer
  • Settings to control the amount of notifications is a
    10·2 answers
  • Which window allows you to view and change your computer's system information and settings?
    9·2 answers
  • If you are trying to improve your budget and spending, which option would save you the most money?
    13·2 answers
  • Application of computer in insurance​
    14·1 answer
  • 5.7 AP-Style MC Practice edhessive
    14·1 answer
  • Describe comm<br>unication cycle​
    15·2 answers
  • Which of the following is an example of an incremented sequence?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!