Skip to content

Commit

Permalink
Update 16.3.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Chen committed Dec 27, 2019
1 parent 5846709 commit 4d03a24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/Chap16/16.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ B(T) & = f(x) d_T(x) + f(y) d_T(y) \\\\
\end{aligned}
$$

Thus, the statement of theorem is true. Now suppose $n > 2$ and also suppose that theorem is true for trees on $n - 1$ leaves.
Thus, the statement of theorem is true. Now suppose $n > 2$ and also suppose that theorem is true for trees on $n - 1$ leaves.
Let $c_1$ and $c_2$ are two sibling leaves in $T$ such that they have the same parent $p$. Letting $T'$ be the tree obtained by deleting $c_1$ and $c_2$, by induction we know that

$$
Expand Down Expand Up @@ -88,7 +88,7 @@ $$
\end{aligned}
$$

That is, where $i$ and $j$ are the upper and lower median,
That is, where $i$ and $j$ are the upper and lower median,
respectively; and $c_i = d_T(x_i) - d_T(x_{n - i + 1})$:

$$f(x_1)c_1 + \cdots + f(x_i)c_i > f(x_j)c_i + \cdots + f(x_n)c_1$$
Expand All @@ -108,7 +108,7 @@ $$
First observe that any full binary tree has exactly $2n - 1$ nodes. We can encode the structure of our full binary tree by performing a preorder traversal of $T$.
For each node that we record in the traversal, write a $0$ if it is an internal node and a $1$ if it is a leaf node. Since we know the tree to be full, this uniquely determines its structure.

Next, note that we can encode any character of $C$ in $\lceil \lg n \rceil$ bits. Since there are $n$ characters, we can encode them in order of appearance in our preorder traversal using ndlg ne bits.
Next, note that we can encode any character of $C$ in $\lceil \lg n \rceil$ bits. Since there are $n$ characters, we can encode them in order of appearance in our preorder traversal using $n\left\lceil \lg n \right\rceil$ bits.

## 16.3-7

Expand Down

0 comments on commit 4d03a24

Please sign in to comment.