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

Giulio holds a bag of 70 marbles in his hands. Jim blindfolds Giulio and keeps adding marbles to Giulio's bag, one at a time. However, Giulio notices the differ
on the coordinate grid ,the point (3,3) undergoes a translation 2 over 4 explain what this mean and give the coordinate of it's new position​
need help and explanation ASAP thank you​
which of the following is equivalent to the quotient below​
find the value of p .(√n)to the power p equal to n​
Environmental science
Please answer gggggggggggggggggg
Manuel has started to become easily confused and has some memory loss. He is also frequently tired and has developed some swelling and a rash. What is most like
Estimate the quotient using compatible numbers. 486÷ 5
Among the licensed drivers in the same age group, what is the probability that a 66-year-old was involved in an accident? Use the table below.