Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 8 (P/Cr level). Worth 20 marks k@param min lower bound * @param max: upper bound @return number of items that are in the range
QUESTION 8 (P/Cr level). Worth 20 marks k@param min lower bound * @param max: upper bound @return number of items that are in the range [min, max] k For example, if state of list is: * head-> 2-> 8 -> -5-> 0-> 12-> 1-> null, min = 0, max = 8, return 4 k if state of list is: * head-> 2-> 8 -> -5-> 0-> 12-> 1-> null, min = 100, max = 200, return 0 if state of list is: * head-> 2-> 8 -> -5-> 0-> 12-> 1-> null, min = 10, max = 0, return 0 *(no item can be in range [10, 0] if state of list is: * head -> 2 8 50 - 12 - 1 - null, min - -10, max -2, return 1 public int countInRange(int min, int max) ( return 0; //to be completed QUESTION 9. Worth 10 marks k@param item: item that should be removed from the list kremove all occurrences of the given item from the list public void removeAll (int item) { /to be completed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started