Coding question - given a binary tree, write code to count the sum off all siblings.
Anonymous
int totalNumberOfNodes(Node root) { if(root == null) return 0; return 1 + totalNumberOfNodes(root.left) + totalNumberOfNodes(root.right); }
Check out your Company Bowl for anonymous work chats.