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

What are the pros can cons of knowing medical terms and word components?
Animals eat and digest food to obtain the energy available for life activities. Discuss energy use inanimals. In your discussion, be sure to:State one inference
Simplify 4 + (−3) − 2 × (−6)
how to name alkane using iupac system
I don't get this question help me
How many deaths in the play result, directly or indirectly, from Hamlet's plot for revenge?
Which best describes how the fossil record supports the theory of evolution?
There are 24 offices in a building that contains 4 floors. On average, how many offices are on each floor?
Which composer called himself a tone poet? a. Schumann b. Mendelssohn c. Schubert d. Beethoven
whats the best title for a research paper about people with disabilities