Permalink
Commits on Mar 5, 2017
Commits on Mar 4, 2017
  1. Fix index error.

    xiaohanyu committed Mar 4, 2017
    General pattern for a list of $x_i$ should be $x_1, x_2, \cdots,
    x_{n-1}, x_{n}$.
  2. Fix a code error in appendix.

    xiaohanyu committed Mar 4, 2017
    `span` is a function with two parameters, and it should be called with
    two parameters in a `let`.
  3. Typo fix

    xiaohanyu committed Mar 4, 2017
Commits on Mar 3, 2017
  1. Fix an error in build-heap section.

    xiaohanyu committed Mar 3, 2017
    If the last level of a complete binary tree can contain at most $2^{p - 1}$
    nodes, then the total nodes of the binary tree is
    
    \[
    \sum_{i = 0}^{p - 1} 2^{i} = 2^{p} - 1
    \]
    
    So it should be $2^{p} - 1 \leq n$ instead of $2^{p} \leq n$.
    
    An example:
    
         7
       /   \
      6     5
     / \   / \
    4   3 2   1
    
    This binary has 7 nodes, the last level has 4 nodes, so $p = 3$, and $n
    = 7$, it should be $2^3 - 1 \leq 7$ instead of $2^3 \leq 7$.