Ask 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 negative

C. Return false

D. Throws an unfound element exception

+2
Answers (1)
  1. 17 February, 23:13
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers