Skip to content

Commit

Permalink
Update 17.2.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Alpaca-kun authored and Jay Chen committed Aug 8, 2020
1 parent 87465b6 commit 37d7149
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/Chap17/17.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Since we have the size of the stack never exceed $k$, and there are always $k$ o

> Redo Exercise 17.1-3 using an accounting method of analysis.
Let $c_i =$ csot of $i$th operation.
Let $c_i =$ cost of $i$th operation.

$$
c_i =
Expand All @@ -23,7 +23,7 @@ i & \text{if $i$ is an exact power of $2$}, \\\\
\end{cases}
$$

Charge each operation $3$ (amotized cost $\hat c_i$).
Charge $3$ (amortized cost $\hat c_i$) for each operation.

- If $i$ is not an exact power of $2$, pay $\$1$, and store $\$2$ as credit.
- If $i$ is an exact power of $2$, pay $\$i$, using stored credit.
Expand Down

0 comments on commit 37d7149

Please sign in to comment.