Question: Given the Node class and the singly linked list class MyLinkedList provided below: public class Node { private object info=null; public Node link=null; public Node

Given the Node class and the singly linked list class MyLinkedList provided below: public class Node { private object info=null; public Node link=null; public Node (Object newElement) { info newElement;} public Node (Object newElement, Node n) { info newElement; link = n; } public object getData() { return info; } } MacBook public class MyLinkedlist private Node head - null; publie Node getRead() return heads 1 public void setHead (Node head) { this.head-head:) ) // elass Add a method to the MyLinkedList class that counts the total number of nodes in the list that contain numbers divisible by 3 or 6. Use the following method heading tatter completing the missing part) to write your work. Note that you need to cast the info object to int in order to be able to process it. public .........count Divisible // Add your code here MacBook Air 11 80 DDO DOO # $ 4 % 5 & 7 6 1 V 0 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
