The 2 examples given in this problem show binary search trees.

This makes it seem as if the problem is to find longest consecutive sequence in a binary search tree.

If this is the case, it should be stated explicitly. If it is not the case, the trees in the example should be replaced with binary tress which are not BST.