/* amethod to find the maximum node value in the linkedlist*/
maxNode(list) {
let current = list.head;
let max = 0;
while (current) {
if (current.value > max) {
max = current.value
}
current = current.next;
}
return max;
}