-
Notifications
You must be signed in to change notification settings - Fork 1
/
mutations.html
114 lines (93 loc) · 1.49 KB
/
mutations.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Random mutations</title>
<style>
:root {
--bg: white;
--text: oklch(25% 0 0);
--soft: oklch(42% 0 0);
--hard: black;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: oklch(31.14% 0.021 285.75);
--text: oklch(90% 0.008 286.75);
--soft: oklch(78.61% 0.021 285.75);
--hard: white;
}
}
body {
background-color: var(--bg);
color: var(--text);
}
small {
color: var(--soft);
}
b {
color: var(--hard);
}
body {
margin: 4rem;
}
@media (width < 44rem) {
body {
margin: 1rem;
}
}
header p {
margin-top: -0.5rem;
font-style: italic;
margin-bottom: 2rem;
}
main {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
</style>
</head>
<body>
<header>
<h2>Random mutations</h2>
<p>
<small>
Manav Rathi<br>
Summer, 2019
</small>
</p>
</header>
<main>
<div>
<pre>
def <b>dfs</b>(s, adj):
xs = [s]
visited = set()
while xs:
u = xs.pop()
if u not in visited:
print(u)
visited.add(u)
for v in adj.get(u, []):
xs.append(v)
</pre>
</div>
<div>
<pre>
def <b>bfs</b>(s, adj):
xs = [s]
visited = set()
while xs:
u = xs.pop(<b>0</b>)
if u not in visited:
print(u)
visited.add(u)
for v in adj.get(u, []):
xs.append(v)
</pre>
</div>
</main>
</body>
</html>