Unless you don't know what a binary tree is, or are forbidden to use recursion, you should be able to figure it out even if you have never studied algorithms. This is FizzBuzz level stuff.
The only difficulty should be if representing a binary tree in the language you are using involves pointers/references or nesting that you do not understand. In that case, the question has exposed a serious gap in your knowledge of that language which you really should fix. It's OK to not know the more esoteric features of a language, but you should know how it handles pointers/references or nested data structures.