add numOfChild algorithm for BST