Skip to content

Commit

Permalink
automata commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eldridgejm committed Jan 14, 2025
1 parent af6d0ea commit 23181fb
Show file tree
Hide file tree
Showing 19 changed files with 436 additions and 436 deletions.
248 changes: 124 additions & 124 deletions practice/midterm-01.html

Large diffs are not rendered by default.

176 changes: 88 additions & 88 deletions practice/midterm-02.html

Large diffs are not rendered by default.

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-4f4b16f9-5c6a-433d-b479-69fa1d91ee6f" style="display: none"><span class="math">\(n\)</span></span>
<span id="button-4f4b16f9-5c6a-433d-b479-69fa1d91ee6f">
<span id="answer-363b2d73-37a1-4125-98c5-c14107877e4c" style="display: none"><span class="math">\(n\)</span></span>
<span id="button-363b2d73-37a1-4125-98c5-c14107877e4c">
<button
type="button"
onclick="
document.getElementById('answer-4f4b16f9-5c6a-433d-b479-69fa1d91ee6f').style.display = 'inline-block';
document.getElementById('button-4f4b16f9-5c6a-433d-b479-69fa1d91ee6f').style.display = 'none'
document.getElementById('answer-363b2d73-37a1-4125-98c5-c14107877e4c').style.display = 'inline-block';
document.getElementById('button-363b2d73-37a1-4125-98c5-c14107877e4c').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-4eb8ddf4-d7fb-49a9-ae73-b7cd62903422" style="display: none"><span class="math">\(\sqrt n \log n\)</span></span>
<span id="button-4eb8ddf4-d7fb-49a9-ae73-b7cd62903422">
<span id="answer-347f8bb8-ca08-4f49-9007-27350aaa87bc" style="display: none"><span class="math">\(\sqrt n \log n\)</span></span>
<span id="button-347f8bb8-ca08-4f49-9007-27350aaa87bc">
<button
type="button"
onclick="
document.getElementById('answer-4eb8ddf4-d7fb-49a9-ae73-b7cd62903422').style.display = 'inline-block';
document.getElementById('button-4eb8ddf4-d7fb-49a9-ae73-b7cd62903422').style.display = 'none'
document.getElementById('answer-347f8bb8-ca08-4f49-9007-27350aaa87bc').style.display = 'inline-block';
document.getElementById('button-347f8bb8-ca08-4f49-9007-27350aaa87bc').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-76e2326c-21a8-494b-bb86-8672fb993d52" style="display: none"><span class="math">\(n^2\)</span></span>
<span id="button-76e2326c-21a8-494b-bb86-8672fb993d52">
<span id="answer-0507fef3-1567-414d-83ba-a6cdfb6d4e37" style="display: none"><span class="math">\(n^2\)</span></span>
<span id="button-0507fef3-1567-414d-83ba-a6cdfb6d4e37">
<button
type="button"
onclick="
document.getElementById('answer-76e2326c-21a8-494b-bb86-8672fb993d52').style.display = 'inline-block';
document.getElementById('button-76e2326c-21a8-494b-bb86-8672fb993d52').style.display = 'none'
document.getElementById('answer-0507fef3-1567-414d-83ba-a6cdfb6d4e37').style.display = 'inline-block';
document.getElementById('button-0507fef3-1567-414d-83ba-a6cdfb6d4e37').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-33aa519b-c7d8-4a6d-baf4-5bd955f6a208" style="display: none"><span class="math">\(\Theta(n^3)\)</span></span>
<span id="button-33aa519b-c7d8-4a6d-baf4-5bd955f6a208">
<span id="answer-7b1fa13c-72f4-44d9-bc29-80230f016d9f" style="display: none"><span class="math">\(\Theta(n^3)\)</span></span>
<span id="button-7b1fa13c-72f4-44d9-bc29-80230f016d9f">
<button
type="button"
onclick="
document.getElementById('answer-33aa519b-c7d8-4a6d-baf4-5bd955f6a208').style.display = 'inline-block';
document.getElementById('button-33aa519b-c7d8-4a6d-baf4-5bd955f6a208').style.display = 'none'
document.getElementById('answer-7b1fa13c-72f4-44d9-bc29-80230f016d9f').style.display = 'inline-block';
document.getElementById('button-7b1fa13c-72f4-44d9-bc29-80230f016d9f').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-4b2c442d-18ef-410c-a3e1-dbaa33ba408f" style="display: none">4</span>
<span id="button-4b2c442d-18ef-410c-a3e1-dbaa33ba408f">
<span id="answer-aff02e68-d6f3-41ae-8b14-8c8aeecf7ac5" style="display: none">4</span>
<span id="button-aff02e68-d6f3-41ae-8b14-8c8aeecf7ac5">
<button
type="button"
onclick="
document.getElementById('answer-4b2c442d-18ef-410c-a3e1-dbaa33ba408f').style.display = 'inline-block';
document.getElementById('button-4b2c442d-18ef-410c-a3e1-dbaa33ba408f').style.display = 'none'
document.getElementById('answer-aff02e68-d6f3-41ae-8b14-8c8aeecf7ac5').style.display = 'inline-block';
document.getElementById('button-aff02e68-d6f3-41ae-8b14-8c8aeecf7ac5').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-ea72c583-0611-4e3d-81ff-e6d8e455873e" style="display: none">9</span>
<span id="button-ea72c583-0611-4e3d-81ff-e6d8e455873e">
<span id="answer-d3bfaaf9-d46a-46c7-a56a-0c3546e6679e" style="display: none">9</span>
<span id="button-d3bfaaf9-d46a-46c7-a56a-0c3546e6679e">
<button
type="button"
onclick="
document.getElementById('answer-ea72c583-0611-4e3d-81ff-e6d8e455873e').style.display = 'inline-block';
document.getElementById('button-ea72c583-0611-4e3d-81ff-e6d8e455873e').style.display = 'none'
document.getElementById('answer-d3bfaaf9-d46a-46c7-a56a-0c3546e6679e').style.display = 'inline-block';
document.getElementById('button-d3bfaaf9-d46a-46c7-a56a-0c3546e6679e').style.display = 'none'
"
>
Show Answer
Expand Down
32 changes: 16 additions & 16 deletions practice/tags/best and worst case.html
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,13 @@ <h3 class="subproblem-id">Part 1)</h3>
<p>What is the <b>best case</b> time complexity of this code as a function of <span class="math">\(n\)</span>? State your answer using asymptotic notation.</p>
<p>
<span class="inline-response-box">
<span id="answer-69907ed5-f2f8-4015-8fc8-39ab34905aee" style="display: none"><span class="math">\(\Theta(n)\)</span></span>
<span id="button-69907ed5-f2f8-4015-8fc8-39ab34905aee">
<span id="answer-4a373d1f-9b09-4fca-85b0-c7b5cccbe0c3" style="display: none"><span class="math">\(\Theta(n)\)</span></span>
<span id="button-4a373d1f-9b09-4fca-85b0-c7b5cccbe0c3">
<button
type="button"
onclick="
document.getElementById('answer-69907ed5-f2f8-4015-8fc8-39ab34905aee').style.display = 'inline-block';
document.getElementById('button-69907ed5-f2f8-4015-8fc8-39ab34905aee').style.display = 'none'
document.getElementById('answer-4a373d1f-9b09-4fca-85b0-c7b5cccbe0c3').style.display = 'inline-block';
document.getElementById('button-4a373d1f-9b09-4fca-85b0-c7b5cccbe0c3').style.display = 'none'
"
>
Show Answer
Expand All @@ -406,13 +406,13 @@ <h3 class="subproblem-id">Part 2)</h3>
<p>What is the <b>worst case</b> time complexity of this code as a function of <span class="math">\(n\)</span>? State your answer using asymptotic notation.</p>
<p>
<span class="inline-response-box">
<span id="answer-f58d63b0-c882-4bf8-a32a-84d087aa811c" style="display: none"><span class="math">\(\Theta(n^2)\)</span></span>
<span id="button-f58d63b0-c882-4bf8-a32a-84d087aa811c">
<span id="answer-23176cca-7d43-4091-8355-903840dcc652" style="display: none"><span class="math">\(\Theta(n^2)\)</span></span>
<span id="button-23176cca-7d43-4091-8355-903840dcc652">
<button
type="button"
onclick="
document.getElementById('answer-f58d63b0-c882-4bf8-a32a-84d087aa811c').style.display = 'inline-block';
document.getElementById('button-f58d63b0-c882-4bf8-a32a-84d087aa811c').style.display = 'none'
document.getElementById('answer-23176cca-7d43-4091-8355-903840dcc652').style.display = 'inline-block';
document.getElementById('button-23176cca-7d43-4091-8355-903840dcc652').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -447,13 +447,13 @@ <h3 class="subproblem-id">Part 1)</h3>
<p>What is a <b>tight</b> theoretical lower bound for this problem? Again, you may assume that the lists are both sorted. State your answer in asymptotic notation as a function of <span class="math">\(n\)</span>.</p>
<p>
<span class="inline-response-box">
<span id="answer-07d1c5bb-9259-4dfe-9a3b-aeb065d3d26b" style="display: none"><span class="math">\(\Theta(n)\)</span></span>
<span id="button-07d1c5bb-9259-4dfe-9a3b-aeb065d3d26b">
<span id="answer-e3902a4f-6aa4-430c-a07c-cb65b5e1a6fc" style="display: none"><span class="math">\(\Theta(n)\)</span></span>
<span id="button-e3902a4f-6aa4-430c-a07c-cb65b5e1a6fc">
<button
type="button"
onclick="
document.getElementById('answer-07d1c5bb-9259-4dfe-9a3b-aeb065d3d26b').style.display = 'inline-block';
document.getElementById('button-07d1c5bb-9259-4dfe-9a3b-aeb065d3d26b').style.display = 'none'
document.getElementById('answer-e3902a4f-6aa4-430c-a07c-cb65b5e1a6fc').style.display = 'inline-block';
document.getElementById('button-e3902a4f-6aa4-430c-a07c-cb65b5e1a6fc').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -514,13 +514,13 @@ <h2>Problem #191</h2>
<p>What is the best case time complexity of <span class="inline-code"><code>foo</code></span> as a function of <span class="math">\(n\)</span>? State your answer using asymptotic notation.</p>
<p>
<span class="inline-response-box">
<span id="answer-fe931b1d-2358-4971-9035-c20f404ea712" style="display: none"><span class="math">\(\Theta(n)\)</span></span>
<span id="button-fe931b1d-2358-4971-9035-c20f404ea712">
<span id="answer-428c1930-b95f-4c32-9cb3-1817f67a98b7" style="display: none"><span class="math">\(\Theta(n)\)</span></span>
<span id="button-428c1930-b95f-4c32-9cb3-1817f67a98b7">
<button
type="button"
onclick="
document.getElementById('answer-fe931b1d-2358-4971-9035-c20f404ea712').style.display = 'inline-block';
document.getElementById('button-fe931b1d-2358-4971-9035-c20f404ea712').style.display = 'none'
document.getElementById('answer-428c1930-b95f-4c32-9cb3-1817f67a98b7').style.display = 'inline-block';
document.getElementById('button-428c1930-b95f-4c32-9cb3-1817f67a98b7').style.display = 'none'
"
>
Show Answer
Expand Down
16 changes: 8 additions & 8 deletions practice/tags/binary search trees.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,13 @@ <h2>Problem #188</h2>
<p>Suppose a collection of unique numbers is stored in a <b>balanced</b> binary search tree, and that each node in the tree has been given a <span class="inline-code"><code>.size</code></span> attribute which contains the number of nodes in the subtree rooted at that node. What is the time complexity required of an efficient algorithm for computing the number of elements in the collection which are larger than some threshold, <span class="math">\(t\)</span>?</p>
<p>
<span class="inline-response-box">
<span id="answer-a6106de8-4ca9-467e-b7d5-33dfbe9e0aa5" style="display: none"><span class="math">\(\Theta(\log n)\)</span></span>
<span id="button-a6106de8-4ca9-467e-b7d5-33dfbe9e0aa5">
<span id="answer-df2161c4-92f0-4c42-8609-34b2b4e89d82" style="display: none"><span class="math">\(\Theta(\log n)\)</span></span>
<span id="button-df2161c4-92f0-4c42-8609-34b2b4e89d82">
<button
type="button"
onclick="
document.getElementById('answer-a6106de8-4ca9-467e-b7d5-33dfbe9e0aa5').style.display = 'inline-block';
document.getElementById('button-a6106de8-4ca9-467e-b7d5-33dfbe9e0aa5').style.display = 'none'
document.getElementById('answer-df2161c4-92f0-4c42-8609-34b2b4e89d82').style.display = 'inline-block';
document.getElementById('button-df2161c4-92f0-4c42-8609-34b2b4e89d82').style.display = 'none'
"
>
Show Answer
Expand All @@ -293,13 +293,13 @@ <h2>Problem #194</h2>
<p>Suppose a collection of <span class="math">\(n\)</span> numbers is stored in a balanced binary search tree. What is the time complexity required of an efficient algorithm to calculate the mean of the collection? State your answer as a function of <span class="math">\(n\)</span> in asymptotic notation.</p>
<p>
<span class="inline-response-box">
<span id="answer-a7c84d80-4f8a-4225-86cc-0bc9c4fe407e" style="display: none"><span class="math">\(\Theta(n)\)</span></span>
<span id="button-a7c84d80-4f8a-4225-86cc-0bc9c4fe407e">
<span id="answer-b106a627-e446-4ebd-b5ae-08bf9297b4ea" style="display: none"><span class="math">\(\Theta(n)\)</span></span>
<span id="button-b106a627-e446-4ebd-b5ae-08bf9297b4ea">
<button
type="button"
onclick="
document.getElementById('answer-a7c84d80-4f8a-4225-86cc-0bc9c4fe407e').style.display = 'inline-block';
document.getElementById('button-a7c84d80-4f8a-4225-86cc-0bc9c4fe407e').style.display = 'none'
document.getElementById('answer-b106a627-e446-4ebd-b5ae-08bf9297b4ea').style.display = 'inline-block';
document.getElementById('button-b106a627-e446-4ebd-b5ae-08bf9297b4ea').style.display = 'none'
"
>
Show Answer
Expand Down
Loading

0 comments on commit 23181fb

Please sign in to comment.