Anki Deck Changes

Commit: 87cc0c8c - merge changes

Author: obrhubr <obrhubr@gmail.com>

Date: 2025-12-24T14:23:16+01:00

Changes: 5 note(s) changed (5 added, 0 modified, 0 deleted)

Note 1: ETH::A&D

Deck: ETH::A&D
Note Type: Horvath Classic
GUID: A8P;P^G,v4
added

Previous

Note did not exist

New Note

Front

ETH::1._Semester::A&D::04._Sorting_Algorithms
Runtime of sorting an array containing only \(1, 0\)?

Back

ETH::1._Semester::A&D::04._Sorting_Algorithms
Runtime of sorting an array containing only \(1, 0\)?

Using bucketsort, we can achieve \(O(n)\). this seems contradictory.
We go through the array once, counting occurences of \(0\) as x. We then add \(x\) zeros in the beginning and fill the rest with 1s.
Field-by-field Comparison
Field Before After
Front Runtime of sorting an array containing only&nbsp;\(1, 0\)?
Back Using bucketsort, we can achieve&nbsp;\(O(n)\). this seems contradictory.<br>We go through the array once, counting occurences of&nbsp;\(0\)&nbsp;as x. We then add&nbsp;\(x\)&nbsp;zeros in the beginning and fill the rest with 1s.
Tags: ETH::1._Semester::A&D::04._Sorting_Algorithms

Note 2: ETH::A&D

Deck: ETH::A&D
Note Type: Horvath Classic
GUID: B#Jj9:E=8j
added

Previous

Note did not exist

New Note

Front

ETH::1._Semester::A&D::11._Minimum_Spanning_Trees
Cut and Paste Proof of Cut-Property:

Back

ETH::1._Semester::A&D::11._Minimum_Spanning_Trees
Cut and Paste Proof of Cut-Property:

Let $(S, V - S)$ be any cut of a graph $G$. 
Let $e = (u,v)$ be the minimal edge crossing this cut. 
We want to show that $e \in T$. 

  1. Assume \(e \not \in T\) for contradiction.
  2. Since \(T\) is a spanning tree, \(T \cup {u}\) contains a cycle, crossing the cut at least twice (once via \(e\) and once via another edge \(e’\).)
  3. We now construct \(T’= (T \cup {e}) \setminus {e’}\) which breaks the cycle but keeps the MST property.
  4. Since \(w(e) < w(e’)\), \(w(T’) < w(T)\) and thus \(T\) is not an MST.
Field-by-field Comparison
Field Before After
Front Cut and Paste Proof of <b>Cut-Property</b>:
Back <div>Let $(S, V - S)$ be any cut of a graph $G$.&nbsp;</div><div>Let $e = (u,v)$ be the minimal edge crossing this cut.&nbsp;</div><div>We want to show that $e \in T$.&nbsp;</div><div><br></div><div><ol><li>Assume&nbsp;\(e \not \in T\)&nbsp;for contradiction.</li><li>Since&nbsp;\(T\)&nbsp;is a spanning tree, \(T \cup {u}\)&nbsp;contains a cycle, crossing the cut at least twice (once via&nbsp;\(e\)&nbsp;and once via another edge&nbsp;\(e’\).)</li><li>We now construct&nbsp;\(T’= (T \cup {e}) \setminus {e’}\)&nbsp;which breaks the cycle but keeps the MST property.</li><li>Since&nbsp;\(w(e) &lt; w(e’)\),&nbsp;\(w(T’) &lt; w(T)\)&nbsp;and thus&nbsp;\(T\)&nbsp;is not an MST.</li></ol></div>
Tags: ETH::1._Semester::A&D::11._Minimum_Spanning_Trees

Note 3: ETH::A&D

Deck: ETH::A&D
Note Type: Horvath Cloze
GUID: KCjL6r:?jQ
added

Previous

Note did not exist

New Note

Front

ETH::1._Semester::A&D::07._Graphs::1._Introduction_to_Graphs
A graph with more than \(n-1\) edges has a cycle if it is undirected.

Back

ETH::1._Semester::A&D::07._Graphs::1._Introduction_to_Graphs
A graph with more than \(n-1\) edges has a cycle if it is undirected.
Field-by-field Comparison
Field Before After
Text A graph with more than&nbsp;\(n-1\)&nbsp;edges has {{c1::a cycle}} if it is {{c1::undirected}}.
Tags: ETH::1._Semester::A&D::07._Graphs::1._Introduction_to_Graphs

Note 4: ETH::A&D

Deck: ETH::A&D
Note Type: Horvath Cloze
GUID: NGdgt3D+pd
added

Previous

Note did not exist

New Note

Front

ETH::1._Semester::A&D::02._Asymptotic_Notation
We can ignore the base of a logarithm only if it's not in the exponent.

Back

ETH::1._Semester::A&D::02._Asymptotic_Notation
We can ignore the base of a logarithm only if it's not in the exponent.

\(e^{\log_2 n} \neq \Theta(e^{\log_3 n})\) as \(e^{\log_2 n - \log_3 n} = e^{\ln n (\frac{1}{\ln(2)} - \frac{1}{\ln(3)})}\) goes to \(\infty\)
Field-by-field Comparison
Field Before After
Text We can ignore the base of a logarithm {{c1:: only if it's not in the exponent}}.
Extra \(e^{\log_2 n} \neq \Theta(e^{\log_3 n})\)&nbsp;as&nbsp;\(e^{\log_2 n - \log_3 n} = e^{\ln n (\frac{1}{\ln(2)} - \frac{1}{\ln(3)})}\)&nbsp;goes to&nbsp;\(\infty\)
Tags: ETH::1._Semester::A&D::02._Asymptotic_Notation

Note 5: ETH::A&D

Deck: ETH::A&D
Note Type: Horvath Classic
GUID: o3QNr=]FF`
added

Previous

Note did not exist

New Note

Front

ETH::1._Semester::A&D::07._Graphs::1._Introduction_to_Graphs
What is contracting an edge?

Back

ETH::1._Semester::A&D::07._Graphs::1._Introduction_to_Graphs
What is contracting an edge?

We contract \(\{v, w\}\) by:
  1. replacing \(v\) and \(w\) by a single vertex \(vw\)
  2. Replacy any edge \(\{v,x\}\) or \(\{w, x\}\) by \(\{vw, x\}\).
  3. Set the weights to their previous ones, and the minimum if there was more than one.
Field-by-field Comparison
Field Before After
Front What is&nbsp;<b>contracting</b>&nbsp;an edge?
Back We contract&nbsp;\(\{v, w\}\)&nbsp;by:<br><ol><li>replacing&nbsp;\(v\)&nbsp;and&nbsp;\(w\)&nbsp;by a single vertex&nbsp;\(vw\)</li><li>Replacy any edge&nbsp;\(\{v,x\}\)&nbsp;or&nbsp;\(\{w, x\}\)&nbsp;by&nbsp;\(\{vw, x\}\).</li><li>Set the weights to their previous ones, and the minimum if there was more than one.</li></ol>
Tags: ETH::1._Semester::A&D::07._Graphs::1._Introduction_to_Graphs
↑ Top