summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--other/josephus2.cpp4
-rw-r--r--other/josephusK.cpp2
-rw-r--r--other/other.tex1
-rw-r--r--other/split.cpp5
-rw-r--r--tcr.pdfbin253381 -> 253149 bytes
5 files changed, 6 insertions, 6 deletions
diff --git a/other/josephus2.cpp b/other/josephus2.cpp
index c0bcc2f..a973609 100644
--- a/other/josephus2.cpp
+++ b/other/josephus2.cpp
@@ -1,8 +1,8 @@
-int rotateLeft(int n) { // Gibt Index des letzten Überlebenden zurück, 1-basiert.
+int rotateLeft(int n) { // Der letzte Überlebende, 1-basiert.
for (int i = 31; i >= 0; i--)
if (n & (1 << i)) {
n &= ~(1 << i);
break;
}
n <<= 1; n++; return n;
-} \ No newline at end of file
+}
diff --git a/other/josephusK.cpp b/other/josephusK.cpp
index 8758fee..522b584 100644
--- a/other/josephusK.cpp
+++ b/other/josephusK.cpp
@@ -1,4 +1,4 @@
-int josephus(int n, int k) { // Gibt Index des letzten Überlebenden zurück, 0-basiert.
+int josephus(int n, int k) { // Der letzte Überlebende, 0-basiert.
if (n == 1) return 0;
return (josephus(n - 1, k) + k) % n;
} \ No newline at end of file
diff --git a/other/other.tex b/other/other.tex
index a8ebdf5..3271542 100644
--- a/other/other.tex
+++ b/other/other.tex
@@ -60,7 +60,6 @@ $n$ Personen im Kreis, jeder $k$-te wird erschossen.
\item Bipartites Matching mit Gewichten auf linken Knoten.
Minimiere Matchinggewicht.
Lösung: Sortiere Knoten links aufsteigend nach Gewicht, danach nutze normlen Algorithmus (\textsc{Kuhn}, Seite \pageref{kuhn})
- \item \textbf{Tobi, cool down!}
\end{itemize}
\subsection{Sonstiges}
diff --git a/other/split.cpp b/other/split.cpp
index ea7d5ff..5e3966c 100644
--- a/other/split.cpp
+++ b/other/split.cpp
@@ -1,4 +1,5 @@
-vector<string> split(string &s, string delim) { // Zerlegt s anhand aller Zeichen in delim.
+// Zerlegt s anhand aller Zeichen in delim.
+vector<string> split(string &s, string delim) {
vector<string> result; char *token;
token = strtok((char*)s.c_str(), (char*)delim.c_str());
while (token != NULL) {
@@ -6,4 +7,4 @@ vector<string> split(string &s, string delim) { // Zerlegt s anhand aller Zeiche
token = strtok(NULL, (char*)delim.c_str());
}
return result;
-} \ No newline at end of file
+}
diff --git a/tcr.pdf b/tcr.pdf
index 08c8cc7..1da53c6 100644
--- a/tcr.pdf
+++ b/tcr.pdf
Binary files differ