Question: Question 1 [10 Marks] Write a method called isProper in the class KWLinkedList (a class for doubly linked list as discussed in the lectures) that

 Question 1 [10 Marks] Write a method called isProper in the

Question 1 [10 Marks] Write a method called isProper 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!