shaneikadawson9084 shaneikadawson9084
  • 30-08-2019
  • Computers and Technology
contestada

Suppose you are give a linked list of integers whose items are sorted. Which is the most efficient way to search the list to determine if a given value x is in the list?

Respuesta :

ExieFansler ExieFansler
  • 11-09-2019

Answer:

Linear Search.

Explanation:

Binary search is an efficient method for the arrays because in arrays accessing the middle element is very easy and fast but accessing middle in linked is not as easy as arrays the memory allocation of nodes of linked list is dynamic.

So to find an element with value x in the linked list we can search it by traversing the list.Visiting each node at a time.

Whose worst case time complexity will be O(n).

Answer Link

Otras preguntas

Explain how you can use a pattern of clapping sounds to transfer information. PLS HELPPPPPPPP.
Write an algebraic expression for the situation. 28 divided by a number g
Guys what are some good fun stuff to do in San Diego????
WILL GIVE BRAINLIEST
Write an algebraic expression for the situation. 7 times the sum of y and 1/3
Match the word with the definition.
How can you tell from the equation of a rational function if the function has a hole in the graph ( a removable discontinuity) at x, rather than a vertical asym
Title of the novel:Dreaming of light. 1.Who is the protagonist in this novel? 2.How does the Novel begin? 3.Where does the novel take place? 4.What is the main
anyone wan na talk?????
what do you think is more phisically and mentally challenging hilking or trekking why​