Question: Is this correct? 71 // return Double. NEGATIVE INFINITY if the linked list is empty 720 public double max ( ) { 73 / /

Is this correct?

71 // return Double. NEGATIVE INFINITY if the linked list is empty 720 public double max ( ) { 73 / / TODO 74 if (head == null) { 75 return 0; 76 77 double max = head. item; 78 Node curr = head. next; 79 while (curr != null) { 80 if (curr . item max) { 81 max = curr . item; 82 83 curr = curr. next; 84 85 return max; 86 } 87

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 Mathematics Questions!