Question: Question 1 [10 Marks] Write a method called is Proper in the class KWLinkedList (a class for doubly linked list as discussed in the lectures)
![Question 1 [10 Marks] Write a method called is Proper in](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3d73e51499_38166f3d73de8ba0.jpg)
Question 1 [10 Marks] Write a method called is Proper in the class KWLinkedList (a class for doubly linked list as discussed in the lectures) that accepts one parameter called elem of type int. If elem exists in the list and the node before elem has data less than elem and the node after elem has data greater than elem, return true. In all other cases return false. If the list is empty or does not contain elem return false. If the elem is in the first node or last node, then also return false. Note: Do not use iterators. Example: elem: 35 list (before method call): 15 75 20 35 40 60 45 Method heading: public boolean is Proper( int elem)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
