summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--content/datastructures/datastructures.tex2
-rw-r--r--content/datastructures/unionFind.cpp4
-rw-r--r--content/graph/binary_lifting.cpp2
-rw-r--r--content/graph/graph.tex6
-rw-r--r--content/math/math.tex2
-rw-r--r--content/math/tables/stuff.tex2
-rw-r--r--content/math/transforms/andTransform.cpp4
-rw-r--r--content/math/transforms/bitwiseTransforms.cpp6
-rw-r--r--content/math/transforms/orTransform.cpp4
-rw-r--r--content/math/transforms/xorTransform.cpp2
10 files changed, 17 insertions, 17 deletions
diff --git a/content/datastructures/datastructures.tex b/content/datastructures/datastructures.tex
index 1c51475..38d63d9 100644
--- a/content/datastructures/datastructures.tex
+++ b/content/datastructures/datastructures.tex
@@ -78,7 +78,7 @@
\sourcecode{datastructures/bitset.cpp}
\end{algorithm}
-\begin{algorithm}{Link-Cut-Tree}
+\begin{algorithm}{Link/Cut Tree}
\begin{methods}
\method{LCT}{baut Wald auf}{n}
\method{connected}{prüft ob zwei Knoten im selben Baum liegen}{\log(n)}
diff --git a/content/datastructures/unionFind.cpp b/content/datastructures/unionFind.cpp
index 36a4b45..8861790 100644
--- a/content/datastructures/unionFind.cpp
+++ b/content/datastructures/unionFind.cpp
@@ -15,11 +15,11 @@ struct UnionFind {
return true;
}
- int size(int a) {
+ int size(int a) { // optional
return -unions[find(a)];
}
- int add() {
+ int add() { // optional
unions.push_back(-1);
return ssize(unions) - 1;
}
diff --git a/content/graph/binary_lifting.cpp b/content/graph/binary_lifting.cpp
index f88b1a9..5ed6c07 100644
--- a/content/graph/binary_lifting.cpp
+++ b/content/graph/binary_lifting.cpp
@@ -3,7 +3,7 @@ struct Lift {
Lift(vector<vector<int>> &adj, int root):
dep(adj.size()), par(adj.size()), jmp(adj.size(), root) {
- auto dfs = [&](auto &self, int u, int p, int d) -> void {
+ auto dfs = [&](auto &&self, int u, int p, int d) -> void {
dep[u] = d, par[u] = p;
jmp[u] = dep[p] + dep[jmp[jmp[p]]] == 2*dep[jmp[p]]
? jmp[jmp[p]] : p;
diff --git a/content/graph/graph.tex b/content/graph/graph.tex
index bf51d74..f6f3d02 100644
--- a/content/graph/graph.tex
+++ b/content/graph/graph.tex
@@ -118,7 +118,7 @@
\subsubsection{\textsc{Floyd-Warshall}-Algorithmus}
\method{floydWarshall}{kürzeste Pfade oder negative Kreise finden}{\abs{V}^3}
\begin{itemize}
- \item \code{dist[i][i] = 0, dist[i][j] = edge\{j, j\}.weight} oder \code{INF}
+ \item \code{dist[i][i] = 0, dist[i][j] = edge\{i, j\}.weight} oder \code{INF}
\item \code{i} liegt auf einem negativen Kreis $\Leftrightarrow$ \code{dist[i][i] < 0}.
\end{itemize}
\sourcecode{graph/floydWarshall.cpp}
@@ -140,12 +140,12 @@ Sei $a_{ij}$ die Adjazenzmatrix von $G$ \textcolor{gray}{(mit $a_{ii} = 1$)}, da
\begin{algorithm}{Dynamic Connectivity}
\begin{methods}
\method{Constructor}{erzeugt Baum ($n$ Knoten, $m$ updates)}{n+m}
- \method{addEdge}{fügt Kannte ein,\code{id}=delete Zeitpunkt}{\log(n)}
+ \method{addEdge}{fügt Kante ein, \code{id} = delete-Zeitpunkt}{\log(n)}
\method{eraseEdge}{entfernt Kante \code{id}}{\log(n)}
\end{methods}
\sourcecode{graph/connect.cpp}
\end{algorithm}
-\clearpage
+\columnbreak
diff --git a/content/math/math.tex b/content/math/math.tex
index 7764d54..5899c97 100644
--- a/content/math/math.tex
+++ b/content/math/math.tex
@@ -7,7 +7,7 @@
\end{itemize}
\sourcecode{math/longestIncreasingSubsequence.cpp}
\end{algorithm}
-\vfill\null\columnbreak
+\columnbreak
\begin{algorithm}{Zykel Erkennung}
\begin{methods}
diff --git a/content/math/tables/stuff.tex b/content/math/tables/stuff.tex
index 82f2d3f..9ad4739 100644
--- a/content/math/tables/stuff.tex
+++ b/content/math/tables/stuff.tex
@@ -3,7 +3,7 @@
\hline
\multicolumn{2}{|c|}{Verschiedenes} \\
\hline
- Türme von Hanoi, minimale Schirttzahl: &
+ Türme von Hanoi, minimale Schrittzahl: &
$T_n = 2^n - 1$ \\
\#Regionen zwischen $n$ Geraden &
diff --git a/content/math/transforms/andTransform.cpp b/content/math/transforms/andTransform.cpp
index 9e40c74..87bae0b 100644
--- a/content/math/transforms/andTransform.cpp
+++ b/content/math/transforms/andTransform.cpp
@@ -3,6 +3,6 @@ void fft(vector<ll>& a, bool inv = false) {
for (int s = 1; s < n; s *= 2) {
for (int i = 0; i < n; i += 2 * s) {
for (int j = i; j < i + s; j++) {
- ll& u = a[j], &v = a[j + s];
- tie(u, v) = inv ? pair(u - v, v) : pair(u + v, v);
+ ll &u = a[j], &v = a[j + s];
+ u = inv ? u - v : u + v;
}}}}
diff --git a/content/math/transforms/bitwiseTransforms.cpp b/content/math/transforms/bitwiseTransforms.cpp
index 17f3163..c0f6e50 100644
--- a/content/math/transforms/bitwiseTransforms.cpp
+++ b/content/math/transforms/bitwiseTransforms.cpp
@@ -3,9 +3,9 @@ void bitwiseConv(vector<ll>& a, bool inv = false) {
for (int s = 1; s < n; s *= 2) {
for (int i = 0; i < n; i += 2 * s) {
for (int j = i; j < i + s; j++) {
- ll& u = a[j], &v = a[j + s];
- tie(u, v) = inv ? pair(u - v, v) : pair(u + v, v); // AND
- //tie(u, v) = inv ? pair(u, v - u) : pair(u, v + u); //OR
+ ll &u = a[j], &v = a[j + s];
+ u = inv ? u - v : u + v; // AND
+ //v = inv ? v - u : v + u; // OR
//tie(u, v) = pair(u + v, u - v); // XOR
}}}
//if (inv) for (ll& x : a) x /= n; // XOR (careful with MOD)
diff --git a/content/math/transforms/orTransform.cpp b/content/math/transforms/orTransform.cpp
index 6503a68..1833ac5 100644
--- a/content/math/transforms/orTransform.cpp
+++ b/content/math/transforms/orTransform.cpp
@@ -3,6 +3,6 @@ void fft(vector<ll>& a, bool inv = false) {
for (int s = 1; s < n; s *= 2) {
for (int i = 0; i < n; i += 2 * s) {
for (int j = i; j < i + s; j++) {
- ll& u = a[j], &v = a[j + s];
- tie(u, v) = inv ? pair(u, v - u) : pair(u, v + u);
+ ll &u = a[j], &v = a[j + s];
+ v = inv ? v - u : v + u;
}}}}
diff --git a/content/math/transforms/xorTransform.cpp b/content/math/transforms/xorTransform.cpp
index 075aac3..aa3db8d 100644
--- a/content/math/transforms/xorTransform.cpp
+++ b/content/math/transforms/xorTransform.cpp
@@ -3,7 +3,7 @@ void fft(vector<ll>& a, bool inv = false) {
for (int s = 1; s < n; s *= 2) {
for (int i = 0; i < n; i += 2 * s) {
for (int j = i; j < i + s; j++) {
- ll& u = a[j], &v = a[j + s];
+ ll &u = a[j], &v = a[j + s];
tie(u, v) = pair(u + v, u - v);
}}}
if (inv) for (ll& x : a) x /= n;