Why is it necessary to take a new variable "head" in for loop?
Why is it necessary to take a new variable "head" in for loop? Question: class Node: def __init__(self, data): self.data = data self.ref = None def Print_LL(linkedlist): if linkedlist is None: print("LinkedList is empty!!") else: while linkedlist is not None: print(linkedlist.data) linkedlist = linkedlist.ref def arr_to_LL(arr, n): linkedlist = None for i in range(0,n): new_node …