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 can be done by government to protect the traditional art and culture ?​
Purpose of physical change
When graphed in the (x,y) coordinate plane, at what point do the lines x - y = 12 and y= 2 intersect?
write each fraction number as a decimal 2 1/8
What is the Color of trioxonitrate(v)
what was the jews reaction to the roman rule?
Please help me with this question, and show working out.
Multiply. 4.62 x 10^6
GIVING BRAINLIEST EXTRA POINTS !!! I am 5'2, and standing 40 feet from a tree. the angle on the protractor is 30 feet which makes it an angle of 90 degrees... h
1. What is one characteristic that all living things and only living things have in common? 2.How did both the Redi and Pasteur experiments prove there was no s