Binary tree + string manipulation