Skip to content

Commit 94ce072

Browse files
committed
update exercises
1 parent beb7c95 commit 94ce072

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

docs/exercises/1 tree layout.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818

1919
# TODO fill in the dots, possibly making changes to the surrounding code
20-
def postorder(n, level=0): ...
20+
def postorder(n, level=0):
21+
...
2122

2223

2324
postorder(root)

docs/exercises/2 topsort.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# %%
22
# This cell generates a random graph for the topological sort to run on.
33

4-
# %matplotlib widget
4+
%matplotlib widget
55
from ogdf_python import ogdf, cppinclude
66
import cppyy
77

@@ -52,7 +52,8 @@ def make_graph():
5252
# %%
5353
# TODO implement the algorithm in this reusable function
5454
# this should work similar to the DFS example
55-
def topo_step(): ...
55+
def topo_step():
56+
...
5657

5758

5859
# %%

docs/exercises/3 dijkstra.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def cmp(a, b): # comparator function for two nodes a, b
4343

4444

4545
# %%
46-
def step(): ...
46+
def step():
47+
...
4748

4849

4950
# %%
@@ -55,7 +56,8 @@ def step(): ...
5556
b_step = ipywidgets.Button(description="Step")
5657

5758

58-
def b_step_click(*args): ...
59+
def b_step_click(*args):
60+
...
5961

6062

6163
b_step.on_click(b_step_click)

docs/exercises/4 contraction.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ def make_graph():
4646

4747

4848
# %%
49-
def contract(a, b): ...
49+
def contract(a, b):
50+
...
5051

5152

5253
# %%
53-
def check_degs(): ...
54+
def check_degs():
55+
...
5456

5557

5658
# %%

0 commit comments

Comments
 (0)