Ask Question
11 December, 05:14

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

+2
Answers (1)
  1. 11 December, 07:31
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers