shahrukhafridi4863 shahrukhafridi4863
  • 22-08-2019
  • Computers and Technology
contestada

in the ADT sorted list, what does the getPosition method do when the entry being searched for is not in the list?

A. Return 0

B. Return negative

C. Return false

D. Throws an unfound element exception

Respuesta :

ExieFansler ExieFansler
  • 30-08-2019

Answer:

B. Return negative

Explanation:

In ADT sorted list the getPosition method returns negative actually it returns -1 when the element for which they are searching is not present in the list.

It does not return 0 since it returns negative.

The method is an integer type method so it cannot return boolean values.

It does not throws an exception.

So we conclude that the option a is the correct answer.

Answer Link

Otras preguntas

The cluster of developing cells from conception until birth is called what?
What is 0.25 divided by 1.075?
The graph shows how much money Dante earns for different numbers of hours worked. What is the slope of the line and what does it mean in this situation? A. The
what type of logical fallacy is I am so tired because I am just exhausted!
how many molecules are in 450g of NaNO3?
Explain what was the nature of the disagreement about the terms under which former, confederate states might rejoin the union after the civil war.
what is a histogram? i have a question on it and i dont know how to answer it
Seven is at most the quotient of a number D and -5
valley forge would you have quit
For a protein to be an integral membrane protein, it would have to be _____.