Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1 points QUESTION 95 The element() method in the Queue interface 1· retrieves an

ID: 3740118 • Letter: 1

Question

1 points QUESTION 95 The element() method in the Queue interface 1· retrieves and removes the head of this queue, or null if this queue is empty C retrieves and removes the head of this queue and throws an exception if this queue is empty C retrieves, but does not remove, the head of this queue, returning nullif this queue is empty C retrieves, but does not remove, the head of this queue, throwing an exception if this queue is empty 1 points QUESTION 96 I. How many times is the factorial method in Listing 18.1 (page 707 in the textbook) invoked for factorialkS)? C5

Explanation / Answer

ANSWER 95: Here option(C) is correct because element() method retrieves, but does not remove, the head of this queue. This method differs from peek only in that it throws an exception if this queue is empty.

ANSWER 96: Here from the factorial code factorial () will call 5 times for factorial(5).option(C) is correct.