Question: Class Node { int data: Node next: Node(int data) { (this.data = data: } Node (int data. Node next) { this.data = data: this.next =
Class Node { int data: Node next: Node(int data) { (this.data = data: } Node (int data. Node next) { this.data = data: this.next = next: } } Using the Node class above implement the following functions for a linked-list. Please mark any assumptions you make. (a) Implement the contains function, return true if found, false otherwise. public static boolean contains (int data) { (b) Implement the maxValue function. Returns the largest value in the LinkList. public static int maxValue () {
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
