the second question was a little tougher, "Write a function that checks whether a binary tree is valid or not. A valid binary tree is a tree where no child node points to any of its ancestors"
Sigiloso
Use BFS with a queue, for each new element q[n] n is even check if q[n/2] is pointing to the same element.