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

calculate the area of a circle with the diameter of 10.4 cm
Simplify the expression. (2q5)4 2q20 2q625 16q9 16q20
Find the value of ‘A’ in the set of supplementary angles.
Rationality implies that in order to get waht they want, people will spend the most time and effort doing what
what is 5+7x squared +4x i will name you brainlest
what was the name giving to communist rebel fighters in south vietnam
What is the value of x in the figure? Enter your answer in the box. x = Three lines creating six angles with the top left angle having a square on it indicati
Which line from the quatrain best summarizes its central idea?
Jessica has 9 kess dollars than Daniel. Altogether, Jessica and Daniel have 31 dollars. How much money does Jessica have?
I really need the answers as soon as possible. So I hope you answer this