rosemcclain8534 rosemcclain8534
  • 21-09-2019
  • Computers and Technology
contestada

What is the time complexity of the contains operation and the find operation for both implementations?

Respuesta :

ExieFansler ExieFansler
  • 26-09-2019

Answer:

Contains O(n)  and find O(n).

Explanation:

Both methods are used in Java .The time complexity of both contains and find methods is O(n).This is because both of them work like a linear search works both the methods they traverse the list or the array elements one by one to look for the element.So iterating over each element gives the time complexity of O(n).

Answer Link

Otras preguntas

What is bigger 0.25 0.025 0.24 0.026
what are the six climate zones and their sub-regions ?
the ratio two numbers is 3 and 5 their sum is 135find two number
When three or more doctors deliver health care and make joint use of equipment, supplies, and personnel, this is called a(n)?
Is a 3.15 gpa good or bad?
Which of the following sentences contains a spelling error? a. billy and shelly studied together for the math test last night. b. coby wrote an incredible ess
Who wrote all the king's men?
Define flesh eating disease
A hormone attaches to a target cell at a receptor protein. What do you know about this hormone? it is steroid hormone it will bind directly to DNA it is able to
How many grams are needed to obtain 1.5 moles of mgco3?