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

(x + 3) (2x^2 - 4X - 7 )
To create an educational presentation for patients, a medical assistant would most likely use what?
Does a waist-to-hip ratio show extra weight on up your hips
PLEASE HELP ME. Give an everyday example of an action and reaction pair that does produce motion and one that does not.
manny can make 12 pizzas in 3/4 hour how many pizzas can he make in 4 hours
If every dimension of a two-dimensional figure is multiplied by k, by what quantity is the area multiplied?
Write the point-slope form of the line passing through (2, -12) and perpendicular to y=3x.
when did neanderthals arrive in europe?
Which situations involve descriptive statistics ? Select each correct answer A) a bowler's scorecard shows he threw a strike on one-fifth of his throws that ni
Make n the subject of the formula: M=3n+5