Skip to content

Commit

Permalink
fix some absolute links
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobkogler committed Sep 24, 2023
1 parent c17890b commit 7935df4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/data_structures/sqrt-tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Sqrt Tree can process such queries in $O(1)$ time with $O(n \cdot \log \log n)$

### Building sqrt decomposition

Let's make a [sqrt decomposition](/data_structures/sqrt_decomposition.html). We divide our array in $\sqrt{n}$ blocks, each block has size $\sqrt{n}$. For each block, we compute:
Let's make a [sqrt decomposition](sqrt_decomposition.md). We divide our array in $\sqrt{n}$ blocks, each block has size $\sqrt{n}$. For each block, we compute:

1. Answers to the queries that lie in the block and begin at the beginning of the block ($\text{prefixOp}$)
2. Answers to the queries that lie in the block and end at the end of the block ($\text{suffixOp}$)
Expand Down
2 changes: 1 addition & 1 deletion src/others/josephus_problem.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ It is required to find the last number.
This task was set by **Flavius Josephus** in the 1st century (though in a somewhat narrower formulation: for $k = 2$).

This problem can be solved by modeling the procedure.
Brute force modeling will work $O(n^{2})$. Using a [Segment Tree](/data_structures/segment_tree.html), we can improve it to $O(n \log n)$.
Brute force modeling will work $O(n^{2})$. Using a [Segment Tree](../data_structures/segment_tree.md), we can improve it to $O(n \log n)$.
We want something better though.

## Modeling a $O(n)$ solution
Expand Down
4 changes: 2 additions & 2 deletions src/string/manacher.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ It's a surprising fact that there is an algorithm, which is simple enough, that

## Solution

In general, this problem has many solutions: with [String Hashing](/string/string-hashing.html) it can be solved in $O(n\cdot \log n)$, and with [Suffix Trees](/string/suffix-tree-ukkonen.html) and fast LCA this problem can be solved in $O(n)$.
In general, this problem has many solutions: with [String Hashing](string-hashing.md) it can be solved in $O(n\cdot \log n)$, and with [Suffix Trees](suffix-tree-ukkonen.md) and fast LCA this problem can be solved in $O(n)$.

But the method described here is **sufficiently** simpler and has less hidden constant in time and memory complexity. This algorithm was discovered by **Glenn K. Manacher** in 1975.

Expand Down Expand Up @@ -124,7 +124,7 @@ Again, we should not forget to update the values $(l, r)$ after calculating each
At the first glance it's not obvious that this algorithm has linear time complexity, because we often run the naive algorithm while searching the answer for a particular position.
However, a more careful analysis shows that the algorithm is linear. In fact, [Z-function building algorithm](/string/z-function.html), which looks similar to this algorithm, also works in linear time.
However, a more careful analysis shows that the algorithm is linear. In fact, [Z-function building algorithm](z-function.md), which looks similar to this algorithm, also works in linear time.
We can notice that every iteration of trivial algorithm increases $r$ by one. Also $r$ cannot be decreased during the algorithm. So, trivial algorithm will make $O(n)$ iterations in total.
Expand Down

0 comments on commit 7935df4

Please sign in to comment.