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

what has resulted in an increased need for nursing assistant?
Explain why human civilizations developed along the east-west axis rather than along the north-south axis.
Question 12 the length of a rectangle is three times its width. if the perimeter of the rectangle is 40 m , find its area.
f(x) = log base 3 (x+1) what is f^-1 (2)
(Picture) please help asap!
What type of silicate minerals is shown from this arrangement of silicon tetrahedron?
Find the value of x and y
List the ways in which scholars look for clues, ranking the methods from what you think would be the most useful to the least useful
Gilbert's employer matches 12% of Gilbert's contributions to his 401(k) plan. If Gilbert's employer contributed $600 to the plan last year, how much did Gilbert
three times a number less than the sum of twice the number and 1