i want to obtain the binary code of all the leafes of a bin tree. have any ideea on how to do that?

i code 0 for left and 1 of right.
Thank you!