Autodesk Interview Question

Question on binary trees and strings