I look at the code you posted and reviewed your question, the quandary that I am left with is: "This is not your code." The next thing that comes to mind is that it looks a lot like a homework problem from HS or an entry level comp sci class, either being the case, then I'll assume you are taking it to get a grade. The next quandary that comes to mind is: "How are you going to give me credit for your course for doing your homework?"
So... Do you have a specific question, other than, please do my homework for me, like: I don't understand what a binary tree does... tons of examples on google there, or how do I decide if it's a left node or right node--also tons of examples there on google.
If you have a specific question, please ask. while this is not a homework service, there are many experienced programmers waiting to help you understand, but no do the work for you.