Skip to content

Commit

Permalink
automata commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eldridgejm-machine-user committed Oct 26, 2024
1 parent e9f551a commit b069d97
Show file tree
Hide file tree
Showing 18 changed files with 352 additions and 352 deletions.
248 changes: 124 additions & 124 deletions practice/midterm-01.html

Large diffs are not rendered by default.

88 changes: 44 additions & 44 deletions practice/midterm-02.html
Original file line number Diff line number Diff line change
Expand Up @@ -1778,13 +1778,13 @@ <h2>Problem #209</h2>
<p>Suppose an <b>undirected</b> graph has 16 edges. What is the <i>smallest</i> number of nodes it can have?</p>
<p>
<span class="inline-response-box">
<span id="answer-7615ad39-454b-40f8-85bf-084b529d056c" style="display: none">7</span>
<span id="button-7615ad39-454b-40f8-85bf-084b529d056c">
<span id="answer-30842688-4024-42a5-bf96-38d48334c702" style="display: none">7</span>
<span id="button-30842688-4024-42a5-bf96-38d48334c702">
<button
type="button"
onclick="
document.getElementById('answer-7615ad39-454b-40f8-85bf-084b529d056c').style.display = 'inline-block';
document.getElementById('button-7615ad39-454b-40f8-85bf-084b529d056c').style.display = 'none'
document.getElementById('answer-30842688-4024-42a5-bf96-38d48334c702').style.display = 'inline-block';
document.getElementById('button-30842688-4024-42a5-bf96-38d48334c702').style.display = 'none'
"
>
Show Answer
Expand All @@ -1808,13 +1808,13 @@ <h2>Problem #210</h2>
<p>Suppose a <b>directed</b> graph has 5 nodes and 3 edges. What is the greatest possible out degree of any node in the graph?</p>
<p>
<span class="inline-response-box">
<span id="answer-2a42b2c8-7744-472b-81a6-d81de71929b7" style="display: none">4</span>
<span id="button-2a42b2c8-7744-472b-81a6-d81de71929b7">
<span id="answer-a138160a-2c71-464e-a9e2-23194274dd7d" style="display: none">4</span>
<span id="button-a138160a-2c71-464e-a9e2-23194274dd7d">
<button
type="button"
onclick="
document.getElementById('answer-2a42b2c8-7744-472b-81a6-d81de71929b7').style.display = 'inline-block';
document.getElementById('button-2a42b2c8-7744-472b-81a6-d81de71929b7').style.display = 'none'
document.getElementById('answer-a138160a-2c71-464e-a9e2-23194274dd7d').style.display = 'inline-block';
document.getElementById('button-a138160a-2c71-464e-a9e2-23194274dd7d').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -1886,13 +1886,13 @@ <h2>Problem #212</h2>

<p>
<span class="inline-response-box">
<span id="answer-f5fcbbd6-5828-4ba4-b134-96c0d2d0806d" style="display: none"><span class="math">\(\Theta(n)\)</span></span>
<span id="button-f5fcbbd6-5828-4ba4-b134-96c0d2d0806d">
<span id="answer-5819e73b-bbd3-4dc0-97ba-f4eeefb62344" style="display: none"><span class="math">\(\Theta(n)\)</span></span>
<span id="button-5819e73b-bbd3-4dc0-97ba-f4eeefb62344">
<button
type="button"
onclick="
document.getElementById('answer-f5fcbbd6-5828-4ba4-b134-96c0d2d0806d').style.display = 'inline-block';
document.getElementById('button-f5fcbbd6-5828-4ba4-b134-96c0d2d0806d').style.display = 'none'
document.getElementById('answer-5819e73b-bbd3-4dc0-97ba-f4eeefb62344').style.display = 'inline-block';
document.getElementById('button-5819e73b-bbd3-4dc0-97ba-f4eeefb62344').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -1935,13 +1935,13 @@ <h2>Problem #213</h2>
<p>How many times will <span class="inline-code"><code>"Hello!"</code></span> be printed? Note that this is not a full DFS, and that not all nodes are reachable from <span class="math">\(a\)</span>.</p>
<p>
<span class="inline-response-box">
<span id="answer-2c550755-0c0f-40bd-98f6-4d4ef710d543" style="display: none">10</span>
<span id="button-2c550755-0c0f-40bd-98f6-4d4ef710d543">
<span id="answer-92afa432-9c74-421a-a271-6584dbf652e4" style="display: none">10</span>
<span id="button-92afa432-9c74-421a-a271-6584dbf652e4">
<button
type="button"
onclick="
document.getElementById('answer-2c550755-0c0f-40bd-98f6-4d4ef710d543').style.display = 'inline-block';
document.getElementById('button-2c550755-0c0f-40bd-98f6-4d4ef710d543').style.display = 'none'
document.getElementById('answer-92afa432-9c74-421a-a271-6584dbf652e4').style.display = 'inline-block';
document.getElementById('button-92afa432-9c74-421a-a271-6584dbf652e4').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -2018,13 +2018,13 @@ <h2>Problem #216</h2>
<p>What will be the finish time of node <span class="math">\(e\)</span>? Assume the convention that a node's neighbors are produced in alphabetical order.</p>
<p>
<span class="inline-response-box">
<span id="answer-401144e4-dd99-48f4-beb4-ba51fc87d3c7" style="display: none">13</span>
<span id="button-401144e4-dd99-48f4-beb4-ba51fc87d3c7">
<span id="answer-07833bbe-5027-4d51-831d-8e256e0ea05c" style="display: none">13</span>
<span id="button-07833bbe-5027-4d51-831d-8e256e0ea05c">
<button
type="button"
onclick="
document.getElementById('answer-401144e4-dd99-48f4-beb4-ba51fc87d3c7').style.display = 'inline-block';
document.getElementById('button-401144e4-dd99-48f4-beb4-ba51fc87d3c7').style.display = 'none'
document.getElementById('answer-07833bbe-5027-4d51-831d-8e256e0ea05c').style.display = 'inline-block';
document.getElementById('button-07833bbe-5027-4d51-831d-8e256e0ea05c').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -2074,13 +2074,13 @@ <h2>Problem #218</h2>
<center><div class="image"><img src="images/218/graph.png" /></div></center>
<p>
<span class="inline-response-box">
<span id="answer-8445236d-7c3c-4b91-a0d0-41cd714d36ec" style="display: none"><span class="math">\(d\)</span></span>
<span id="button-8445236d-7c3c-4b91-a0d0-41cd714d36ec">
<span id="answer-2f254d66-39ef-4581-83b3-d8b763aafaa6" style="display: none"><span class="math">\(d\)</span></span>
<span id="button-2f254d66-39ef-4581-83b3-d8b763aafaa6">
<button
type="button"
onclick="
document.getElementById('answer-8445236d-7c3c-4b91-a0d0-41cd714d36ec').style.display = 'inline-block';
document.getElementById('button-8445236d-7c3c-4b91-a0d0-41cd714d36ec').style.display = 'none'
document.getElementById('answer-2f254d66-39ef-4581-83b3-d8b763aafaa6').style.display = 'inline-block';
document.getElementById('button-2f254d66-39ef-4581-83b3-d8b763aafaa6').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -2131,13 +2131,13 @@ <h2>Problem #220</h2>
<center><div class="image"><img src="images/220/graph.png" /></div></center>
<p>
<span class="inline-response-box">
<span id="answer-0792d87a-c6ee-45ca-adf1-32283cbe4306" style="display: none">d a b c e</span>
<span id="button-0792d87a-c6ee-45ca-adf1-32283cbe4306">
<span id="answer-19ef2b85-b6d0-4bb9-9dbb-8fed3dda69af" style="display: none">d a b c e</span>
<span id="button-19ef2b85-b6d0-4bb9-9dbb-8fed3dda69af">
<button
type="button"
onclick="
document.getElementById('answer-0792d87a-c6ee-45ca-adf1-32283cbe4306').style.display = 'inline-block';
document.getElementById('button-0792d87a-c6ee-45ca-adf1-32283cbe4306').style.display = 'none'
document.getElementById('answer-19ef2b85-b6d0-4bb9-9dbb-8fed3dda69af').style.display = 'inline-block';
document.getElementById('button-19ef2b85-b6d0-4bb9-9dbb-8fed3dda69af').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -2302,13 +2302,13 @@ <h2>Problem #227</h2>
<p>How many iterations of the outer loop will be run in the worst case? Your answer should be a number.</p>
<p>
<span class="inline-response-box">
<span id="answer-cba1ad0e-7343-4d89-9759-0aceb2a5f190" style="display: none">4</span>
<span id="button-cba1ad0e-7343-4d89-9759-0aceb2a5f190">
<span id="answer-a6c194cd-2232-42e1-afec-4f652e03bde3" style="display: none">4</span>
<span id="button-a6c194cd-2232-42e1-afec-4f652e03bde3">
<button
type="button"
onclick="
document.getElementById('answer-cba1ad0e-7343-4d89-9759-0aceb2a5f190').style.display = 'inline-block';
document.getElementById('button-cba1ad0e-7343-4d89-9759-0aceb2a5f190').style.display = 'none'
document.getElementById('answer-a6c194cd-2232-42e1-afec-4f652e03bde3').style.display = 'inline-block';
document.getElementById('button-a6c194cd-2232-42e1-afec-4f652e03bde3').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -2359,13 +2359,13 @@ <h2>Problem #228</h2>
<p>How many times will <span class="inline-code"><code>"Here!"</code></span> be printed?</p>
<p>
<span class="inline-response-box">
<span id="answer-0348bf9f-ed5d-4366-89b1-e36ac22d0278" style="display: none">2</span>
<span id="button-0348bf9f-ed5d-4366-89b1-e36ac22d0278">
<span id="answer-0df18613-3abf-4ed3-9f2c-08f1dbb570a0" style="display: none">2</span>
<span id="button-0df18613-3abf-4ed3-9f2c-08f1dbb570a0">
<button
type="button"
onclick="
document.getElementById('answer-0348bf9f-ed5d-4366-89b1-e36ac22d0278').style.display = 'inline-block';
document.getElementById('button-0348bf9f-ed5d-4366-89b1-e36ac22d0278').style.display = 'none'
document.getElementById('answer-0df18613-3abf-4ed3-9f2c-08f1dbb570a0').style.display = 'inline-block';
document.getElementById('button-0df18613-3abf-4ed3-9f2c-08f1dbb570a0').style.display = 'none'
"
>
Show Answer
Expand All @@ -2391,13 +2391,13 @@ <h2>Problem #229</h2>
<p>What is the most number of nodes that can be in the queue at any one time?</p>
<p>
<span class="inline-response-box">
<span id="answer-b24755dc-6229-4057-921a-2ed071354b80" style="display: none">8</span>
<span id="button-b24755dc-6229-4057-921a-2ed071354b80">
<span id="answer-caeb5f55-4c7a-4669-ba5d-8e329422e545" style="display: none">8</span>
<span id="button-caeb5f55-4c7a-4669-ba5d-8e329422e545">
<button
type="button"
onclick="
document.getElementById('answer-b24755dc-6229-4057-921a-2ed071354b80').style.display = 'inline-block';
document.getElementById('button-b24755dc-6229-4057-921a-2ed071354b80').style.display = 'none'
document.getElementById('answer-caeb5f55-4c7a-4669-ba5d-8e329422e545').style.display = 'inline-block';
document.getElementById('button-caeb5f55-4c7a-4669-ba5d-8e329422e545').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -2507,13 +2507,13 @@ <h2>Problem #232</h2>
<p>After one iteration of the outer loop of Bellman-Ford, what is the estimated distance to node <span class="math">\(d\)</span>?</p>
<p>
<span class="inline-response-box">
<span id="answer-92de754f-8d51-435a-b006-46ad957b18bc" style="display: none">9</span>
<span id="button-92de754f-8d51-435a-b006-46ad957b18bc">
<span id="answer-7ec90ea8-b17b-4189-8255-d89ad6c0d43a" style="display: none">9</span>
<span id="button-7ec90ea8-b17b-4189-8255-d89ad6c0d43a">
<button
type="button"
onclick="
document.getElementById('answer-92de754f-8d51-435a-b006-46ad957b18bc').style.display = 'inline-block';
document.getElementById('button-92de754f-8d51-435a-b006-46ad957b18bc').style.display = 'none'
document.getElementById('answer-7ec90ea8-b17b-4189-8255-d89ad6c0d43a').style.display = 'inline-block';
document.getElementById('button-7ec90ea8-b17b-4189-8255-d89ad6c0d43a').style.display = 'none'
"
>
Show Answer
Expand Down
32 changes: 16 additions & 16 deletions practice/tags/asymptotic notation.html
Original file line number Diff line number Diff line change
Expand Up @@ -726,13 +726,13 @@ <h2>Problem #185</h2>
<p>Consider the function <span class="math">\(g(n) = f_2(n) / f_1(n)\)</span>. Give the tightest possible upper bound on <span class="math">\(g(n)\)</span>:</p>
<p><span class="math">\(O(\)</span>
<span class="inline-response-box">
<span id="answer-608c932a-6961-4e9b-9347-91127ab9909f" style="display: none"><span class="math">\(n\)</span></span>
<span id="button-608c932a-6961-4e9b-9347-91127ab9909f">
<span id="answer-ea081baf-a4b4-430f-b62c-54e4c5f9284d" style="display: none"><span class="math">\(n\)</span></span>
<span id="button-ea081baf-a4b4-430f-b62c-54e4c5f9284d">
<button
type="button"
onclick="
document.getElementById('answer-608c932a-6961-4e9b-9347-91127ab9909f').style.display = 'inline-block';
document.getElementById('button-608c932a-6961-4e9b-9347-91127ab9909f').style.display = 'none'
document.getElementById('answer-ea081baf-a4b4-430f-b62c-54e4c5f9284d').style.display = 'inline-block';
document.getElementById('button-ea081baf-a4b4-430f-b62c-54e4c5f9284d').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -760,13 +760,13 @@ <h2>Problem #187</h2>
<p>Write <span class="math">\(f(n)\)</span> in asymptotic notation in the simplest terms possible.</p>
<p><span class="math">\(f(n) = \Theta(\)</span>
<span class="inline-response-box">
<span id="answer-e34a85e9-34b4-47e8-937f-3f1416147255" style="display: none"><span class="math">\(\sqrt n \log n\)</span></span>
<span id="button-e34a85e9-34b4-47e8-937f-3f1416147255">
<span id="answer-3ca8815a-3e06-4364-aba6-268805141f6a" style="display: none"><span class="math">\(\sqrt n \log n\)</span></span>
<span id="button-3ca8815a-3e06-4364-aba6-268805141f6a">
<button
type="button"
onclick="
document.getElementById('answer-e34a85e9-34b4-47e8-937f-3f1416147255').style.display = 'inline-block';
document.getElementById('button-e34a85e9-34b4-47e8-937f-3f1416147255').style.display = 'none'
document.getElementById('answer-3ca8815a-3e06-4364-aba6-268805141f6a').style.display = 'inline-block';
document.getElementById('button-3ca8815a-3e06-4364-aba6-268805141f6a').style.display = 'none'
"
>
Show Answer
Expand All @@ -791,13 +791,13 @@ <h2>Problem #195</h2>
<p>Consider the function <span class="math">\(g(n) = f_2(n) / f_1(n)\)</span>. Give the tightest possible upper bound on <span class="math">\(g(n)\)</span>:</p>
<p><span class="math">\(O(\)</span>
<span class="inline-response-box">
<span id="answer-f4257ee8-30b4-43cb-84ac-4a051110c25c" style="display: none"><span class="math">\(n^2\)</span></span>
<span id="button-f4257ee8-30b4-43cb-84ac-4a051110c25c">
<span id="answer-99fbbd8a-cf34-4344-8a27-d93d56ec819c" style="display: none"><span class="math">\(n^2\)</span></span>
<span id="button-99fbbd8a-cf34-4344-8a27-d93d56ec819c">
<button
type="button"
onclick="
document.getElementById('answer-f4257ee8-30b4-43cb-84ac-4a051110c25c').style.display = 'inline-block';
document.getElementById('button-f4257ee8-30b4-43cb-84ac-4a051110c25c').style.display = 'none'
document.getElementById('answer-99fbbd8a-cf34-4344-8a27-d93d56ec819c').style.display = 'inline-block';
document.getElementById('button-99fbbd8a-cf34-4344-8a27-d93d56ec819c').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -874,13 +874,13 @@ <h2>Problem #207</h2>
<p>Define <span class="math">\(f(n) = f_1(n) \times f_2(n) \times f_3(n)\)</span>. What is <span class="math">\(f(n)\)</span>, in asymptotic notation, in simplest terms possible?</p>
<p>
<span class="inline-response-box">
<span id="answer-0e8f96be-22cb-402c-9daf-b9101356b2d7" style="display: none"><span class="math">\(\Theta(n^3)\)</span></span>
<span id="button-0e8f96be-22cb-402c-9daf-b9101356b2d7">
<span id="answer-d90aaba5-bf42-4998-9726-43115cfaad58" style="display: none"><span class="math">\(\Theta(n^3)\)</span></span>
<span id="button-d90aaba5-bf42-4998-9726-43115cfaad58">
<button
type="button"
onclick="
document.getElementById('answer-0e8f96be-22cb-402c-9daf-b9101356b2d7').style.display = 'inline-block';
document.getElementById('button-0e8f96be-22cb-402c-9daf-b9101356b2d7').style.display = 'none'
document.getElementById('answer-d90aaba5-bf42-4998-9726-43115cfaad58').style.display = 'inline-block';
document.getElementById('button-d90aaba5-bf42-4998-9726-43115cfaad58').style.display = 'none'
"
>
Show Answer
Expand Down
16 changes: 8 additions & 8 deletions practice/tags/bellman-ford.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,13 @@ <h2>Problem #227</h2>
<p>How many iterations of the outer loop will be run in the worst case? Your answer should be a number.</p>
<p>
<span class="inline-response-box">
<span id="answer-3b7698dd-1e62-497b-92fb-a458ffb469c1" style="display: none">4</span>
<span id="button-3b7698dd-1e62-497b-92fb-a458ffb469c1">
<span id="answer-44201f12-ebdd-4e31-8c2c-19da0bfe6649" style="display: none">4</span>
<span id="button-44201f12-ebdd-4e31-8c2c-19da0bfe6649">
<button
type="button"
onclick="
document.getElementById('answer-3b7698dd-1e62-497b-92fb-a458ffb469c1').style.display = 'inline-block';
document.getElementById('button-3b7698dd-1e62-497b-92fb-a458ffb469c1').style.display = 'none'
document.getElementById('answer-44201f12-ebdd-4e31-8c2c-19da0bfe6649').style.display = 'inline-block';
document.getElementById('button-44201f12-ebdd-4e31-8c2c-19da0bfe6649').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -303,13 +303,13 @@ <h2>Problem #232</h2>
<p>After one iteration of the outer loop of Bellman-Ford, what is the estimated distance to node <span class="math">\(d\)</span>?</p>
<p>
<span class="inline-response-box">
<span id="answer-25c7fa2f-9335-4b04-8742-4fe632c9934a" style="display: none">9</span>
<span id="button-25c7fa2f-9335-4b04-8742-4fe632c9934a">
<span id="answer-b2b985b0-389c-44db-b84c-eebf1822f7db" style="display: none">9</span>
<span id="button-b2b985b0-389c-44db-b84c-eebf1822f7db">
<button
type="button"
onclick="
document.getElementById('answer-25c7fa2f-9335-4b04-8742-4fe632c9934a').style.display = 'inline-block';
document.getElementById('button-25c7fa2f-9335-4b04-8742-4fe632c9934a').style.display = 'none'
document.getElementById('answer-b2b985b0-389c-44db-b84c-eebf1822f7db').style.display = 'inline-block';
document.getElementById('button-b2b985b0-389c-44db-b84c-eebf1822f7db').style.display = 'none'
"
>
Show Answer
Expand Down
Loading

0 comments on commit b069d97

Please sign in to comment.