Given two binary tree T1 and T2. Write a function to validate if trees are mirror to each other.

Example

T1:                                     T2        1                                1
2 3 3 2
4 5 6 7 7 6 5 4

For two tree T1 and T2 to be mirror. Their root node key must me same. and the left sub-tree of T1 and right sub-tree of T2 should be mirror and vice versa.

class Node {
init(item: Int) {
self.item =…