Skip to content

Commit

Permalink
inverting image
Browse files Browse the repository at this point in the history
  • Loading branch information
nmheim committed May 22, 2024
1 parent 58dad8e commit 9715aab
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion exams/balanced-tree/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ it swaps the parent node with its child.

To implement these functions in Scheme and Haskell (especially the swapping), it is good to use pattern matching.

<img src="/img/balanced-tree-algo.svg" style="width: 100%; margin: auto;">
<img src="/img/balanced-tree-algo.svg" style="width: 100%; margin: auto;" class="inverting-image">


## Racket
Expand Down
2 changes: 1 addition & 1 deletion exams/building-trees/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For example, suppose that the initial tree is just a single node (a leaf) $1$ an
equals $(1,2),(1,3),(5,7),(2,4),(4,5),(3,6)$. By expanding the initial tree by the edges, we obtain
the following sequence of trees:

<img src="/img/building-trees-sequence.svg" style="width: 95%; margin: auto;">
<img src="/img/building-trees-sequence.svg" style="width: 95%; margin: auto;" class="inverting-image">

Note that the third edge $(5,7)$ was ignored because there is no node $5$ in the currently
constructed tree. So the currently constructed tree remains unchanged.
Expand Down
2 changes: 1 addition & 1 deletion exams/finite-automata/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $aba$. On the other hand, it accept neither $ba$ nor $abab$.
Example of NFA where $\mathcal Q=\{1,2,3,4\}$, $\Sigma=\{a,b\}$, $q_0=1$, $\mathcal F=\{2,3\}$
and $\Delta=\{(1,a,2),(2,b,2),(1,a,3),(3,b,4),(4,a,3),(2,a,4)\}$.

<img src="/img/finite-automata-dfa.svg" style="width: 40%; margin: auto;">
<img src="/img/finite-automata-dfa.svg" style="width: 40%; margin: auto;" class="inverting-image">


## Haskell
Expand Down
2 changes: 1 addition & 1 deletion exams/least-common-ancestor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ to $5$ is $1,2,4,5$. Their common prefix is $1,2$ whose last element is $2$.
Similarly, the least common ancestor of $5$ and $8$ is $1$. The least common ancestor of
$7$ and $7$ is $7$.

<img src="/img/least-common-ancestor-tree.svg" style="width: 30%; margin: auto;">
<img src="/img/least-common-ancestor-tree.svg" style="width: 30%; margin: auto;" class="inverting-image">


## Racket
Expand Down
2 changes: 1 addition & 1 deletion exams/minimum-spanning-tree/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $E'\subseteq E$, $T$ is a tree (i.e., a connected graph without cycles) and $\su
minimum possible among such trees. The figure shows an example of a connected weighted
graph and its minimum spanning tree.

![Left: A connected, weighted graph. Right: Its minimum spanning tree of weight 16.](/img/minimum-spanning-tree-graph.svg)
![Left: A connected, weighted graph. Right: Its minimum spanning tree of weight 16.](/img/minimum-spanning-tree-graph.svg){class="inverting-image"}

Your task is to implement an algorithm computing the minimum spanning tree, i.e.,
a function returning for a given connected weighted graph $(V,E)$ the subset $E'$
Expand Down

0 comments on commit 9715aab

Please sign in to comment.