Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
fix katex and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
DET171 committed Feb 23, 2022
1 parent 8c12188 commit 28ef3a7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module.exports = {
'msup',
'mrow',
'annotation',
'mtext',
'semantics',
'math',
].includes(tag));
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/funcs/bs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Binary Search is a searching algorithm used in a sorted array by
repeatedly dividing the search interval in half.

The idea of binary search is to use the information that the array is sorted and
reduce the time complexity to 𝒪(log n).
reduce the time complexity to $\mathcal{O}(\log{n})$.

The basic steps to perform Binary Search are:

Expand Down
6 changes: 3 additions & 3 deletions docs/guide/funcs/bubblesort.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ It is one of the simplest sorting algorithms.

| Cases | Time |
| -------------------------- | ----------------------------------------------------------------------------- |
| Worst-Case Time Complexity | $O(n^2)$. Worst case occurs when array is reverse sorted. |
| Best-Case Time Complexity | $O(n^2)$. Best case occurs when array is already sorted. |
| Auxiliary Space | $O(1)$ |
| Worst-Case Time Complexity | $\mathcal{O}(n^2)$. Worst case occurs when array is reverse sorted. |
| Best-Case Time Complexity | $\mathcal{O}(n^2)$. Best case occurs when array is already sorted. |
| Auxiliary Space | $\mathcal{O}(1)$ |
| Boundary Cases | Bubble sort takes minimum time (order of n) when elements are already sorted. |

| Property | :white_check_mark:/:x: |
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/more-adv/dp.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ long long sum(long long n) {
```
While this method works, it is far too slow and may check multiple numbers multiple times.
At `n = 5`, `sum(2)` is recalculated 3 times.
At $n = 5$, $\text{sum}(n)$ is recalculated 3 times.
### Top-down DP
Expand All @@ -40,7 +40,7 @@ long long sum(long long n) {
}
```

The states are stored in `memo[]`, and the transition is `memo[n] = sum[n - 1] + sum[n - 2]`. The base cases are when `n <= 1`, `memo[n] = n`.
The states are stored in $\text{memo}[]$, and the transition is $\text{memo}[n] = \text{sum}[n - 1] + \text{sum}[n - 2]$. The base cases are when $n \leq 1$, $\text{memo}[n] = n$.

While this form of DP may be more intuitive sometimes, it usually takes up more memory.

Expand All @@ -58,7 +58,7 @@ for (long long i = 2; i < n; i++) {
}
```

The states are stored in `memo[n]`, the base cases are `memo[0]` and `memo[1]`, and the transition is `memo[i] = memo[i - 1] + memo[i - 2]`.
The states are stored in $\text{memo}[n]$, the base cases are $\text{memo}[0]$ and $\text{memo}[1]$, and the transition is $\text{memo}[i] = \text{memo}[i - 1] + \text{memo}[i - 2]$.

### Conclusion

Expand Down

0 comments on commit 28ef3a7

Please sign in to comment.