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

A large piece of jewelry has a mass of 132.6 g. a graduated cylinder initially contains 48.6 ml water. when the jewelry is submerged in the graduated cylinder,
At first we thought Mr. McClean was unpleasant, but in ________ meetings we found him to be friendly. (A) subsequent (B) organized (C) previous (D) unimporta
What is ivan's marginal benefit if he decides to stay open for six hours instead of five hours?
Write an analysis that compares and contrasts the way two myths show one important feature of their culture.
add sun to make a compound word
What event triggered the start of the Spanish- American War?
Match the definition to the term. 1. a list of books about a particular subject or field of study, including a brief description of each book thesaurus 2. or
What is 3/8 divided by 2/4
4141​% of adults say cashews are their favorite kind of nut. you randomly select 12 adults and ask each to name his or her favorite nut. find the probability th
Math:Evaluate the expression using the order of operations.