Question: PYTHON Write a function named triplet_nodes (head) that iterates over a linked list and prints the current node's value and the values of its next
PYTHON

Write a function named triplet_nodes (head) that iterates over a linked list and prints the current node's value and the values of its next two neighbors. If the linked list does not have at least three nodes, return without printing. For example, given this linked list head Node('f', None) head Node('e', head) head Node('d', head) head Node('c', head) head Node('b', head) head Node('a', head) lllllllll triplet_nodes (head) should print: a b c b c d c d e de f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
