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

Is antony correct when he says that the assassins fawned over caesar before killing him
64 children attended a computer course. 5/8 of them were girls. How many more girls than boys were there?
Round each number to the nearest tenth. What is the best estimate for the answer to 382.24 – 297.28?
Compare the value of the 8 in 4,428.37 and 92.85
What is the ratio 10 to 1 written as a fraction on lowest terms?
The largest known fungus is
I don't know what this means Can someone help please My teacher told me to Find a simple, stright forward printed single column page whose designe u like w
Write the number that is 10 more than 98
You can use a linear model to represent the relationship between the hours worked h and the money earned m. When h = 0, then m = 0. If a person earned $39 after
round 1.66667 to the nearest tenth