Imagine that instead of hiring each assistant proper away withinside the hiring assistant problem. we wait till the cease to lease the quality one. what is the quality-, worse- and average-care costs on this case.
There are some assumptions that we are able to make.
Worst case: Every assistant you interview subsequent is higher than the ultimate candidate. So, you need to pass until the cease. The aspect is you interviewed until the cease N, and also you needed to make a contrast with the N-1 interviewee.
So, your complexity can be N*(N-1) = O(N^2)
Best case: The first actual candidate you interviewed became out to be the quality candidate. Here you simply examine with every other candidate if they're higher than the first candidate or not.
So, your complexity, on this case, can be O(N)
Average case: In this case, we're creating a contrast with different candidates. In this case, as well, your complexity could be O(N^2).
For higher clarity, what you may do is navigate grade by grade the subsequent pseudocode:
best_candidate_index = 0
for candidate in range(number_of_interviewee)
do interview candidate
if candidate is higher than best_candidate_index
best_candidate_index = candidate
lease best_candidate_index
Learn more about costs here:
brainly.com/question/28147009
#SPJ4