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

Why is drug abuse common to teenagers???​
human disruption of the carbon cycle has been implicated in..?
Which of the following statements is true of participation in U.S. government? It’s important to vote because everyone working in government is elected. The pre
What is (0, 2) reflected over the x-axis
Whose point of view supports the belief that Reconstruction in the South should not be cruel and harsh so that better relationships between North and South coul
Eukaryotic cells don't have a nucleus.
How does insolation affect precipitation?
Quick help what is 4 2/9 divided by 1/3
What would a decrease in the concentration of greenhouse games in the atmosphere mean for conditions on earth?
The polygons are regular polygons. What is the area of the shaded region? Please my brain literally can’t process this...