in DS edited by
596 views
3 votes
3 votes

Consider a perfect binary tree with $\mathrm{n}$ nodes and $\mathrm{h}$ height. A tree is perfect when all levels of the tree are completely full. Let root is at depth $0$ and leaves are at height $0.$

Assume Expected height of any node is $E_{h}$ and Expected depth of any node is $E_{d}$.

If we choose any node uniformly randomly then which of the following is the correct option about $S1$ and $S2?$

  • $S1: \displaystyle{} E_{d}=\frac{1}{n} \sum_{r=0}^{h} r 2^{r}$
  • $S2: \displaystyle{} E_{h}=\frac{1}{n} \sum_{r=0}^{h} r 2^{h-r}$
  1. $S1$ is correct but $S2$ is incorrect
  2. $S1$ is incorrect but $S2$ is correct
  3. Both are correct
  4. Both are incorrect
in DS edited by
596 views

Please log in or register to answer this question.