Print Head node of every node in Binary Tree
Given the root of the Binary Tree. Print the parent node of each node in the given Binary Tree. Examples : Input: Binary Tree = {1, 2, 3, 4, 5, NULL, NULL, NULL, 6} Output : The Head Node of 6 is 4 The Head Nodeof 5 is 2The Head Node of 4 is 2The Head Node of 3 is 1 The Head Node of 2 is 1 Explanati