Question: Consider the following java class: public class Node{ int data; Node next; } Write a java method DeleteMax which takes as an input a linked
Consider the following java class:
public class Node{
int data;
Node next;
}
Write a java method DeleteMax which takes as an input a linked list head then deletes and returnsthe maximum integer in the list. You can assume that each number in the list is unique.
public int DeleteMax (Node aList) {. you code.}
You code complexity should not be worse than O(n) where n is the number of nodes in the list.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
