Tree Properties & Traversals

Answer & solution
Official answer: 1
The complete seven-node tree has three levels. BFS first visits the root and both children. DFS discovery first visits the root, one child, and one grandchild. Therefore exactly one BFS member, the other child of the root, is absent from the first three DFS members, so |A−B|=1.
Name the root r, children l,u and grandchildren l1,l2,u1,u2. BFS gives {r,l,u}. A left-first DFS gives {r,l,l1}; right-first gives {r,u,u1}. In either case the intersection has two nodes and the BFS-only set has one. The result is independent of which child is explored first.