johnathan is right, but I think this is acceptable in a interview, unless the interviewer is actually asking you for a Morris Traversal method or he test you the knowledge of Threading binary tree.

Unless they are looking for an algorithm expert/senior roles or the interviewer intentionally want to deny you from an offer(Hate to admit this, but sometimes it does exists. If you don't like the interviewee, just blame it on the culture stuff. Think on the position of interviewee, you won't be comfortable if I ask you a ACM question in a interview), this solution is good enough for general interview purpose.