Question: Handwon P . Nodes Reordering You are given a tree which consists of N nodes and an array A where A [ U ] represents
Handwon
P Nodes Reordering
You are given a tree which consists of nodes and an array A where represents the value of nodele
You are also given an array where the parent of node is given by
We say that the path from to is considered good if for each pair of adjacent nodes i j the values written on these nodes satisfy the following condition:
Ai A Aj is smaller than both Ai and where is the bitwise xor operator
Find the maximum length of a good path that you can get.
Note:
it is given that
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
