Autodesk interview question

Question on binary trees and strings