# Template for printing the linked list with forward arrows def print_list_with_forward_arrow(linked_list_node): temp = linked_list_node while temp: print(temp.data, end=" ") # print node value temp = temp.next if temp: print("→", end=" ") else: # if this is the last node, print null at the end print("→ null", end=" ") def print_list_with_forward_arrow_loop(linked_list_node): temp = linked_list_node while temp: print(temp.data, end=" ") # print node value temp = temp.next if temp: print("→", end=" ")