No. I have no idea what language that is written in, but it probably won't compile in it - if nothing else compilers are picky about the number of open brackets matching the number of close brackets, so this:
If (right(x))=null)
Will not compile in any language.
At a guess, it's some kind of pseudocode, and you'll need to implement it in C++ in order to test it properly.
And testing it is part of your task, along with fixing any problems that come up.
Me? I'd start with paper and pencil, drawing a small sample of a tree to check, and manually running through the pseudocode to check all possibilities before I started coding.