Ask Question
3 February, 18:10

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

+1
Answers (1)
  1. 3 February, 19:34
    0
    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.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “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 ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers