You can choose from in-person surveys (one-on-one interviews carried out at high-traffic locations), telephone surveys (less expensive than one-to-one interviews), mail surveys (easy to reach a large audience) and online surveys (simple and inexpensive way to collect data, though not reliable).
A binary tree of depth d is an almost complete binary tree if: 1  Each leaf in the tree is either at level d or at level d â 1. 2  For any node nd in the tree with a right descendant at level d, all the left descendants of nd that are leaves are also at level d.
Check if a given Binary Tree is height balanced like a Red-Black Tree. In a Red-Black Tree, the maximum height of a node is at most twice the minimum height (The four Red-Black tree properties make sure this is always followed). Given a Binary Search Tree, we need to check for following property. For every node, length of the longest leaf to node path has not more than twice the nodes on shortest path from node to leaf. Expected time complexity is O(n). The tree should be traversed at-most once in the solution.