Skip to content

Commit

Permalink
Latest build deployed.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrigjl committed Oct 17, 2024
1 parent 52e0e38 commit 376d6b5
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<!--********************************************-->
<!--* Generated from PreTeXt source *-->
<!--* on 2024-10-16T15:20:09Z *-->
<!--* on 2024-10-17T22:50:59Z *-->
<!--* A recent stable commit (2022-07-01): *-->
<!--* 6c761d3dba23af92cba35001c852aac04ae99a5f *-->
<!--* *-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ <h2 class="search-results-heading">Search Results: </h2>

print(gcd(20,10))
</textarea></div></div></div>
<div class="para" id="introduction_polymorphism-39">Now we can use this function to help reduce any fraction. To put a fraction in lowest terms, we will divide the numerator and the denominator by their greatest common divisor. So, for the fraction <span class="process-math">\(6/8\text{,}\)</span> the greatest common divisor is 2. Dividing the top and the bottom by 2 creates a new fraction, <span class="process-math">\(3/4\)</span> (see <a href="introduction_object-oriented-programming-in-c-defining-classes.html#introduction_lst-newaddmethod" class="xref" data-knowl="./knowl/xref/introduction_lst-newaddmethod.html" data-reveal-label="Reveal" data-close-label="Close" title="Listing 1.12.2: New addition implementation using gcd">Listing 1.12.2</a>).</div>
<div class="para" id="introduction_polymorphism-39">Now we can use this function to help reduce any fraction. To put a fraction in lowest terms, we will divide the numerator and the denominator by their greatest common divisor. So, for the fraction <span class="process-math">\(6/8\text{,}\)</span> the greatest common divisor is 2. Dividing the top and the bottom by 2 creates a new fraction, <span class="process-math">\(3/4\)</span> (see <a href="introduction_object-oriented-programming-in-c-defining-classes.html#introduction_lst-newaddmethod" class="xref" data-knowl="./knowl/xref/introduction_lst-newaddmethod.html" data-reveal-label="Reveal" data-close-label="Close" title="Listing 1.12.2">Listing 1.12.2</a>).</div>
<figure class="listing figure-like" id="introduction_lst-newaddmethod"><pre class="program"><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

Expand Down Expand Up @@ -1194,7 +1194,7 @@ <h2 class="search-results-heading">Search Results: </h2>
return 0;
}
</code></pre>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">1.12.2<span class="period">.</span></span><span class="space"> </span></figcaption></figure><figure class="figure figure-like" id="fig-fraction2cpp"><div class="image-box" style="width: 50%; margin-left: 25%; margin-right: 25%;"><img src="external/Introduction/fraction2cpp.png" class="contained" alt="Visual representation of a Fraction class instance called ’myfraction’. It features concentric circles with the innermost labeled ’State’ showcasing ’num’ with a value of 3 above ’den’ with a value of 5, indicating the fraction’s numerator and denominator. The outer circle is labeled ’Methods’, suggesting the object’s functionality. Two symbols, ’&lt;&lt;’ and ’+’, are shown outside the Methods circle, implying additional methods."></div>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">1.12.2<span class="period">.</span></span><span class="space"> </span>New addition implementation using <code class="code-inline tex2jax_ignore">gcd</code></figcaption></figure><figure class="figure figure-like" id="fig-fraction2cpp"><div class="image-box" style="width: 50%; margin-left: 25%; margin-right: 25%;"><img src="external/Introduction/fraction2cpp.png" class="contained" alt="Visual representation of a Fraction class instance called ’myfraction’. It features concentric circles with the innermost labeled ’State’ showcasing ’num’ with a value of 3 above ’den’ with a value of 5, indicating the fraction’s numerator and denominator. The outer circle is labeled ’Methods’, suggesting the object’s functionality. Two symbols, ’&lt;&lt;’ and ’+’, are shown outside the Methods circle, implying additional methods."></div>
<figcaption><span class="type">Figure</span><span class="space"> </span><span class="codenumber">1.12.3<span class="period">.</span></span><span class="space"> </span>An Instance of the Fraction Class with Two Methods</figcaption></figure><div class="para" id="introduction_polymorphism-42">Our <code class="code-inline tex2jax_ignore">Fraction</code> object now has two very useful methods and looks like <a href="introduction_object-oriented-programming-in-c-defining-classes.html#fig-fraction2cpp" class="xref" data-knowl="./knowl/xref/fig-fraction2cpp.html" data-reveal-label="Reveal" data-close-label="Close" title="Figure 1.12.3">Figure 1.12.3</a>. An additional group of methods that we need to include in our example <code class="code-inline tex2jax_ignore">Fraction</code> class will allow two fractions to compare themselves to one another using <code class="code-inline tex2jax_ignore">==</code>.</div>
<div class="para" id="introduction_polymorphism-43">We want the <code class="code-inline tex2jax_ignore">==</code> operator to compare Fraction objects and to return <code class="code-inline tex2jax_ignore">true</code> if they are equivalent in value, <code class="code-inline tex2jax_ignore">false</code> otherwise. This is a design choice because we want <span class="process-math">\(\frac {1}{2}\)</span> to be considered equal to <span class="process-math">\(\frac {2}{4}\)</span> as well as <span class="process-math">\(\frac {3}{6}\text{,}\)</span> etc. Hence, in the <code class="code-inline tex2jax_ignore">Fraction</code> class, we can implement the <code class="code-inline tex2jax_ignore">==</code> method by cross-multiplying (see <a href="introduction_object-oriented-programming-in-c-defining-classes.html#introduction_lst-cmpmethod-cpp" class="xref" data-knowl="./knowl/xref/introduction_lst-cmpmethod-cpp.html" data-reveal-label="Reveal" data-close-label="Close" title="Task 1.12.4.a: C++">Task 1.12.4.a</a>) rather than by just comparing numerators and denominators.</div>
<div class="para" id="introduction_polymorphism-44">Of course there are other relational operators that can be overridden. For example, the <code class="code-inline tex2jax_ignore">&lt;=</code> operator could be overridden to provide the less than or equal functionality.</div>
Expand Down
2 changes: 1 addition & 1 deletion knowl/xref/advanced-linear-basic_palinedrome-cpp.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@
cout &lt;&lt; palchecker("not a palindrome") &lt;&lt; endl;
}
</code></pre>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">3.18.2<span class="period">.</span></span><span class="space"> </span></figcaption></figure><span class="incontext"><a class="internal" href="linear-basic_palindrome-checker.html#advanced-linear-basic_palinedrome-cpp">in-context</a></span>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">3.18.2<span class="period">.</span></span><span class="space"> </span>Advanced Palindrome Checker</figcaption></figure><span class="incontext"><a class="internal" href="linear-basic_palindrome-checker.html#advanced-linear-basic_palinedrome-cpp">in-context</a></span>
</body>
</html>
2 changes: 1 addition & 1 deletion knowl/xref/fig-palindrome.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<meta name="robots" content="noindex, nofollow">
</head>
<body class="ignore-math">
<figure class="figure figure-like"><div class="image-box" style="width: 50%; margin-left: 25%; margin-right: 25%;"><img src="external/LinearBasic/palindromesetup.png" class="contained"></div>
<figure class="figure figure-like"><div class="image-box" style="width: 50%; margin-left: 25%; margin-right: 25%;"><img src="external/LinearBasic/palindromesetup.png" class="contained" alt='The image depicts adding the word "radar" to a dequeue. Each character is added to the rear of the queue during initialization, when all the characters have been added character afters are removed from each end of the queue: R is removed from the rear and another R is removed from the head of the queue.'></div>
<figcaption><span class="type">Figure</span><span class="space"> </span><span class="codenumber">3.18.1<span class="period">.</span></span><span class="space"> </span>A Deque</figcaption></figure><span class="incontext"><a class="internal" href="linear-basic_palindrome-checker.html#fig-palindrome">in-context</a></span>
</body>
</html>
2 changes: 1 addition & 1 deletion knowl/xref/introduction_lst-newaddmethod.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@
return 0;
}
</code></pre>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">1.12.2<span class="period">.</span></span><span class="space"> </span></figcaption></figure><span class="incontext"><a class="internal" href="introduction_object-oriented-programming-in-c-defining-classes.html#introduction_lst-newaddmethod">in-context</a></span>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">1.12.2<span class="period">.</span></span><span class="space"> </span>New addition implementation using <code class="code-inline tex2jax_ignore">gcd</code></figcaption></figure><span class="incontext"><a class="internal" href="introduction_object-oriented-programming-in-c-defining-classes.html#introduction_lst-newaddmethod">in-context</a></span>
</body>
</html>
2 changes: 1 addition & 1 deletion knowl/xref/linear-basic_lst-printer.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
int timeRemaining; // Time remaining, in "seconds".
};
</code></pre></div>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">3.14.2<span class="period">.</span></span><span class="space"> </span></figcaption></figure><span class="incontext"><a class="internal" href="linear-basic_simulation-printing-tasks.html#linear-basic_lst-printer">in-context</a></span>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">3.14.2<span class="period">.</span></span><span class="space"> </span>The <code class="code-inline tex2jax_ignore">Printer</code> class</figcaption></figure><span class="incontext"><a class="internal" href="linear-basic_simulation-printing-tasks.html#linear-basic_lst-printer">in-context</a></span>
</body>
</html>
2 changes: 1 addition & 1 deletion knowl/xref/linear-basic_lst-qumainsim.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@
cout &lt;&lt; "Average Wait "&lt;&lt;total/waitingTimes.size()&lt;&lt;" secs "&lt;&lt;printQueue.size()&lt;&lt;" tasks remaining."&lt;&lt;endl;
}
</code></pre></div>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">3.14.4<span class="period">.</span></span><span class="space"> </span></figcaption></figure><span class="incontext"><a class="internal" href="linear-basic_simulation-printing-tasks.html#linear-basic_lst-qumainsim">in-context</a></span>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">3.14.4<span class="period">.</span></span><span class="space"> </span>The main simulation function</figcaption></figure><span class="incontext"><a class="internal" href="linear-basic_simulation-printing-tasks.html#linear-basic_lst-qumainsim">in-context</a></span>
</body>
</html>
2 changes: 1 addition & 1 deletion knowl/xref/linear-basic_lst-task.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
int pages;
};
</code></pre></div>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">3.14.3<span class="period">.</span></span><span class="space"> </span></figcaption></figure><span class="incontext"><a class="internal" href="linear-basic_simulation-printing-tasks.html#linear-basic_lst-task">in-context</a></span>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">3.14.3<span class="period">.</span></span><span class="space"> </span>The <code class="code-inline tex2jax_ignore">Task</code> class</figcaption></figure><span class="incontext"><a class="internal" href="linear-basic_simulation-printing-tasks.html#linear-basic_lst-task">in-context</a></span>
</body>
</html>
2 changes: 1 addition & 1 deletion knowl/xref/linear-linked_lst-nodeclass.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
}
};
</code></pre></div>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">4.4.1<span class="period">.</span></span><span class="space"> </span></figcaption></figure><span class="incontext"><a class="internal" href="linear-linked_the-node-class.html#linear-linked_lst-nodeclass">in-context</a></span>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">4.4.1<span class="period">.</span></span><span class="space"> </span><code class="code-inline tex2jax_ignore">Node</code> Class</figcaption></figure><span class="incontext"><a class="internal" href="linear-linked_the-node-class.html#linear-linked_lst-nodeclass">in-context</a></span>
</body>
</html>
2 changes: 1 addition & 1 deletion knowl/xref/linear-linked_lst-orderadd.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
}
}
</code></pre></div>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">4.5.7<span class="period">.</span></span><span class="space"> </span></figcaption></figure><span class="incontext"><a class="internal" href="linear-linked_implementing-an-ordered-linked-list.html#linear-linked_lst-orderadd">in-context</a></span>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">4.5.7<span class="period">.</span></span><span class="space"> </span><code class="code-inline tex2jax_ignore">add</code> Method</figcaption></figure><span class="incontext"><a class="internal" href="linear-linked_implementing-an-ordered-linked-list.html#linear-linked_lst-orderadd">in-context</a></span>
</body>
</html>
2 changes: 1 addition & 1 deletion knowl/xref/linear-linked_lst-orderlist.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
Node* head;
}
</code></pre></div>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">4.5.3<span class="period">.</span></span><span class="space"> </span></figcaption></figure><span class="incontext"><a class="internal" href="linear-linked_implementing-an-ordered-linked-list.html#linear-linked_lst-orderlist">in-context</a></span>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">4.5.3<span class="period">.</span></span><span class="space"> </span><code class="code-inline tex2jax_ignore">OrderedList</code> Member Variable</figcaption></figure><span class="incontext"><a class="internal" href="linear-linked_implementing-an-ordered-linked-list.html#linear-linked_lst-orderlist">in-context</a></span>
</body>
</html>
2 changes: 1 addition & 1 deletion knowl/xref/linear-linked_lst-ordersearch.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
return found;
}
</code></pre></div>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">4.5.5<span class="period">.</span></span><span class="space"> </span></figcaption></figure><span class="incontext"><a class="internal" href="linear-linked_implementing-an-ordered-linked-list.html#linear-linked_lst-ordersearch">in-context</a></span>
<figcaption><span class="type">Listing</span><span class="space"> </span><span class="codenumber">4.5.5<span class="period">.</span></span><span class="space"> </span><code class="code-inline tex2jax_ignore">search</code> Method</figcaption></figure><span class="incontext"><a class="internal" href="linear-linked_implementing-an-ordered-linked-list.html#linear-linked_lst-ordersearch">in-context</a></span>
</body>
</html>
Loading

0 comments on commit 376d6b5

Please sign in to comment.