Informatica interview question

Check given tree is binary or not? Sort the stack without using any built in functions