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

factor 5v^2 - 23v - 10​
Two groups of people need to get across a lake. The first group has 36 people. Its boats can carry 5 passengers. The second group has 24 people. Its boats can c
Pelota / con / niño / rompió / su / la / el / ventana
PLEASE HELP QUICK!!!!!!! the subject is greek mythology
1what's the easiest way to tell if a poem is a sonnet?
What is the density of a population of 250 rats living in a 150 square meter lot? Show all work for credit.
Kelsey has a new baby brother! He weighs 8 lbs 3 oz. The doctor said the baby should gain about 5 ounces per week. At that rate, how much should the baby weigh
Read the following text carefully, then answer the question. Exciting New Gym Opening Soon!!! Northside Gym is opening soon, providing a new level of gym experi
Estimate: 43 divide by 6
Does 8x - 3= 8x have a solution to X