slides
parent
dae6bd2212
commit
e949ca1627
|
@ -281,6 +281,8 @@ schedule:
|
|||
- date: 09/26/22
|
||||
topic: Recursive Analysis; Sorts
|
||||
dow: Mon
|
||||
section_b:
|
||||
slides: slide/11b-RecursionAnalysis.html
|
||||
- date: 09/28/22
|
||||
topic: Recursive Analysis (contd...)
|
||||
dow: Wed
|
||||
|
|
|
@ -0,0 +1,302 @@
|
|||
---
|
||||
template: templates/cse250_2022_slides.erb
|
||||
title: Inductive Proofs, Divide and Conquer
|
||||
date: Sept 21, 2022
|
||||
textbook: Ch. 15
|
||||
---
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Fibonacci</h4>
|
||||
|
||||
<p>What's the complexity? (in terms of <tt>n</tt>)</p>
|
||||
<pre><code>
|
||||
def fibb(n: Int): Long =
|
||||
if(n < 2){ 1 }
|
||||
else { fibb(n-1) + fibb(n-2) }
|
||||
</code></pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Fibonacci</h4>
|
||||
|
||||
$$T(n) = \begin{cases}
|
||||
\Theta(1) & \textbf{if } n < 2\\
|
||||
T(n-1) + T(n-2) + \Theta(1) & \textbf{otherwise}
|
||||
\end{cases}$$
|
||||
|
||||
<p>Solve for $T(n)$</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Divide and Conquer</h4>
|
||||
|
||||
<p>Remember the Towers of Hanoi...</p>
|
||||
<ol>
|
||||
<li class="fragment">You can move $n$ blocks, if you know how to move $n-1$ blocks</li>
|
||||
<li class="fragment">You can move $n-1$ blocks, if you know how to move $n-2$ blocks</li>
|
||||
<li class="fragment">You can move $n-2$ blocks, if you know how to move $n-3$ blocks</li>
|
||||
<li class="fragment">You can move $n-3$ blocks, if you know how to move $n-4$ blocks</li>
|
||||
</ol>
|
||||
<p class="fragment">...</p>
|
||||
<ul>
|
||||
<li class="fragment">You can always move $1$ block</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Divide and Conquer</h4>
|
||||
<p>To solve the problem at $n$:</p>
|
||||
<ul>
|
||||
<li class="fragment"><b>Divide</b> the problem into a problem at $n-1$</li>
|
||||
<li class="fragment"><b>Conquer</b> the $n-1$ problems</li>
|
||||
<li class="fragment"><b>Combine</b> the solutions from $n-1$</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort</h4>
|
||||
|
||||
<p><b>Input:</b> An array with elements in unknown order.</p>
|
||||
<p><b>Output:</b> An array with elements in sorted order.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort</h4>
|
||||
|
||||
<p><b>Observation:</b> Merging two sorted arrays can be done in $O(1)$.</p>
|
||||
<p><b>Idea:</b> Split the input in half, sort each half, and merge.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort</h4>
|
||||
|
||||
<svg data-src="graphics/11b/merge_sort_onestep.svg"/>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort</h4>
|
||||
|
||||
<svg data-src="graphics/11b/merge_sort_allsteps.svg"/>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Divide and Conquer</h4>
|
||||
<p>To solve the problem at $n$:</p>
|
||||
<ul>
|
||||
<li class="fragment"><b>Divide</b> the problem into two problems of size $\frac{n}{2}$</li>
|
||||
<li class="fragment"><b>Conquer</b> the $\frac{n}{2}$ problems</li>
|
||||
<li class="fragment"><b>Combine</b> the solutions from $\frac{n}{2}$</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort</h4>
|
||||
|
||||
<ol>
|
||||
<li>if the sequence has $1$ or $0$ values: Sorted!</li>
|
||||
<li>if the sequence has $n > 1$ values:
|
||||
<ol>
|
||||
<li>Sort values $1$ to $\left\lfloor\frac{n}{2}\right\rfloor-1$</li>
|
||||
<li>Sort values $\left\lfloor\frac{n}{2}\right\rfloor$ to $n$</li>
|
||||
<li>Merge sorted halves</li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort</h4>
|
||||
|
||||
<svg data-src="graphics/11b/merge_example.svg"/>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort</h4>
|
||||
|
||||
<pre><code class="scala">
|
||||
def merge[A: Ordering](left: Seq[A], right: Seq[A]): Seq[A] =
|
||||
{
|
||||
val output = ArrayBuffer[A]()
|
||||
|
||||
// Buffered iterators let us "peek" at the head
|
||||
val leftItems = left.iterator.buffered
|
||||
val rightItems = right.iterator.buffered
|
||||
|
||||
while(leftItems.hasNext || rightItems.hasNext)
|
||||
{
|
||||
if(!left.hasNext) { output.append(left.next) }
|
||||
else if(!right.hasNext){ output.append(right.next) }
|
||||
else if(Ordering[A].lt( left.head, right.head )){
|
||||
output.append(left.next)
|
||||
} else {
|
||||
output.append(right.next)
|
||||
}
|
||||
}
|
||||
output.toSeq
|
||||
}
|
||||
</code></pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort</h4>
|
||||
|
||||
<p>Each time though loop advances either left or right.</p>
|
||||
|
||||
<p><b>Total Runtime: </b> $\Theta(|\texttt{left}| + |\texttt{right}|)$</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort</h4>
|
||||
|
||||
<pre><code class="scala">
|
||||
def sort[A: Ordering](data: Seq[A]): Seq[A] =
|
||||
{
|
||||
if(data.length <= 1) { return data }
|
||||
else {
|
||||
val (left, right) = data.splitAt(data.length / 2)
|
||||
return merge(
|
||||
sort(left),
|
||||
sort(right)
|
||||
)
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Divide and Conquer</h4>
|
||||
|
||||
If we solve a problem of size $n$ by:
|
||||
<ul>
|
||||
<li>Dividing into $a$ sub-problems</li>
|
||||
<li>...where each problem is of size $\frac{n}{b}$ (usually $b=a$)</li>
|
||||
<li>...and stop recurring at $n \leq c$</li>
|
||||
<li>...and the cost of dividing is $D(n)</li>
|
||||
<li>...and the cost of combining is $C(n)</li>
|
||||
</ul>
|
||||
The total cost will be:
|
||||
$$T(n) = \begin{cases}
|
||||
\Theta(1) & \textbf{if } $n \leq c \\
|
||||
a\cdot T(\frac{n}{b}) + D(n) + C(n) & \textbf{otherwise}
|
||||
\end{cases}$$
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort</h4>
|
||||
|
||||
<dl>
|
||||
<dt>Divide: Split the sequence in half</dt>
|
||||
<dd>$D(n) = \Theta(n)$ (can do in $\Theta(1)$)</dd>
|
||||
|
||||
<dt>Conquer: Sort left and right halves</dt>
|
||||
<dd>$a = 2$, $b = 2$, $c = 1$</dd>
|
||||
|
||||
<dt>Combine: Merge halves together</dt>
|
||||
<dd>$C(n) = \Theta(n)$</dd>
|
||||
</dl>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort</h4>
|
||||
|
||||
$$T(n) = \begin{cases}
|
||||
\Theta(1) & \textbf{if } $n \leq 1$ \\
|
||||
2\cdot T(\frac{n}{2}) + \Theta(1) + \Theta(n) & \textbf{otherwise}
|
||||
\end{cases}$$
|
||||
|
||||
<p class="fragment">How can we find a closed-form hypothesis?</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<p><b>Idea: </b> Draw out the cost of each level of recursion.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort: Recursion Tree</h4>
|
||||
|
||||
$$T(n) = \begin{cases}
|
||||
\Theta(1) & \textbf{if } $n \leq 1$ \\
|
||||
2\cdot T(\frac{n}{2}) + \Theta(1) + \Theta(n) & \textbf{otherwise}
|
||||
\end{cases}$$
|
||||
|
||||
|
||||
<svg data-src="graphics/11b/recursion_tree.svg"/>
|
||||
<p>Each node of the tree shows $D(n) + C(n)$ </p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort: Recursion Tree</h4>
|
||||
|
||||
<svg data-src="graphics/11b/recursion_tree.svg"/>
|
||||
|
||||
<p>At level $i$ there are $2^i$ tasks, each with runtime $\Theta(\frac{n}{2^i})$, and there are $\log(n)$ levels.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort: Recursion Tree</h4>
|
||||
|
||||
<p>At level $i$ there are <span class="fragment highlight-current-blue" data-fragment-index="2">$2^i$</span> tasks, each with <span class="fragment highlight-current-blue" data-fragment-index="3">runtime $\Theta(\frac{n}{2^i})$</span>, and there are <span class="fragment highlight-current-blue" data-fragment-index="1">$\log(n)$</span> levels.</p>
|
||||
|
||||
<p>
|
||||
<span class="fragment highlight-current-blue" data-fragment-index="1">$\sum_{i=0}^{\log(n)}$</span>
|
||||
<span class="fragment highlight-current-blue" data-fragment-index="2">$\sum_{j=1}^{2^i}$</span>
|
||||
<span class="fragment highlight-current-blue" data-fragment-index="3">$\Theta(\frac{n}{2^i})$</span>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort: Recursion Tree</h4>
|
||||
|
||||
<p>$$\sum_{i=0}^{\log(n)} \sum_{j=1}^{2^i} \Theta(\frac{n}{2^i})$$</p>
|
||||
<p class="fragment">$$\sum_{i=0}^{\log(n)} (2^i+1-1)\Theta(\frac{n}{2^i})$$</p>
|
||||
<p class="fragment">$$\sum_{i=0}^{\log(n)} 2^i\Theta(\frac{n}{2^i})$$</p>
|
||||
<p class="fragment">$$\sum_{i=0}^{\log(n)} \Theta(n)$$</p>
|
||||
<p class="fragment">$$(\log(n) - 0 + 1) \Theta(n)$$</p>
|
||||
<p class="fragment">$$\Theta(n\log(n)) + \Theta(n)$$</p>
|
||||
<p class="fragment">$$\Theta(n\log(n))$$</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort: Proof By Induction</h4>
|
||||
|
||||
<p>Now use induction to prove that there is a $c, n_0$ such that $T(n) \leq c \cdot n\log(n)$ for any $n > n_0$</p>
|
||||
|
||||
$$T(n) = \begin{cases}
|
||||
c_0 & \textbf{if } $n \leq 1$ \\
|
||||
2\cdot T(\frac{n}{2}) + c_1 + c_2\cdot n & \textbf{otherwise}
|
||||
\end{cases}$$
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort: Proof By Induction</h4>
|
||||
|
||||
<p><b>Base Case:</b> $T(1) \leq c \cdot 1$</p>
|
||||
|
||||
<p class="fragment">$$c_0 \leq c$$</p>
|
||||
<p class="fragment">True for any $c > c_0$</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Merge Sort: Proof By Induction</h4>
|
||||
|
||||
<p><b>Assume:</b> $T(\frac{n}{2}) \leq c \cdot \frac{n}{2} \log\left(\frac{n}{2}\right)$</p>
|
||||
<p><b>Show:</b> $T(n) \leq c \cdot n \log\left(n\right)$</p>
|
||||
|
||||
<p class="fragment">$$2\cdot T(\frac{n}{2}) + c_1 + c_2\cdot n \leq c\cdot n \log(n)$$</p>
|
||||
<p class="fragment">By the assumption and transitivity, showing the following inequality suffices:<br>
|
||||
$$2\cdot c \cdot \frac{n}{2} \log\left(\frac{n}{2}\right) + c_1 + c_2\cdot n \leq c\cdot n \log(n)$$</p>
|
||||
<p class="fragment">$$c \cdot n \log(n) - c n \log(2) + c_1 + c_2\cdot n \leq c\cdot n \log(n)$$</p>
|
||||
<p class="fragment">$$c_1 + c_2\cdot n \leq c\cdot n \log(n) - c \cdot n \log(n) + c n \log(2)$$</p>
|
||||
<p class="fragment">$$c_1 + c_2\cdot n \leq c n \log(2)$$</p>
|
||||
<p class="fragment">$$\frac{c_1}{n \log(2)} + \frac{c_2}{\log(2)} \leq c$$</p>
|
||||
<p class="fragment">True for any $n_0 \geq \frac{\log(2)}{c_1}$ and $c > \frac{c_2}{\log(2)}+1$</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="slide_title">Next time...</h4>
|
||||
|
||||
<ul>
|
||||
<b>Quick Sort</b>
|
||||
<b>Average Runtime</b>
|
||||
</ul>
|
||||
</section>
|
|
@ -0,0 +1,524 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="103.61759mm"
|
||||
height="47.234127mm"
|
||||
viewBox="0 0 103.61759 47.234127"
|
||||
version="1.1"
|
||||
id="svg9285"
|
||||
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
||||
sodipodi:docname="merge_example.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview9287"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:document-units="mm"
|
||||
showgrid="false"
|
||||
inkscape:zoom="1.2273446"
|
||||
inkscape:cx="228.54217"
|
||||
inkscape:cy="200.4327"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1011"
|
||||
inkscape:window-x="1080"
|
||||
inkscape:window-y="352"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1" />
|
||||
<defs
|
||||
id="defs9282" />
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-11.240836,-11.496182)">
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="59.545872"
|
||||
y="40.766102"
|
||||
id="text10088"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan10086"
|
||||
style="stroke-width:0.264583"
|
||||
x="59.545872"
|
||||
y="40.766102" /></text>
|
||||
<g
|
||||
id="g35163"
|
||||
class="fragment fade-out"
|
||||
data-fragment-index="2">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#1a5fb4;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect9368"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="13.578336"
|
||||
y="12.246182" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="17.201374"
|
||||
y="21.603233"
|
||||
id="text15808"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan15806"
|
||||
style="stroke-width:0.264583"
|
||||
x="17.201374"
|
||||
y="21.603233">24</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35168"
|
||||
class="fragment fade-out"
|
||||
data-fragment-index="4">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#1a5fb4;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35144"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="34.745003"
|
||||
y="12.246182" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="38.442455"
|
||||
y="21.563271"
|
||||
id="text17220"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan17218"
|
||||
style="stroke-width:0.264583"
|
||||
x="38.442455"
|
||||
y="21.563271">37</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35173"
|
||||
class="fragment fade-out"
|
||||
data-fragment-index="7">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#1a5fb4;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35148"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="55.911674"
|
||||
y="12.246182" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="59.668385"
|
||||
y="21.563271"
|
||||
id="text18610"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan18608"
|
||||
style="stroke-width:0.264583"
|
||||
x="59.668385"
|
||||
y="21.563271">62</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35178"
|
||||
class="fragment fade-out"
|
||||
data-fragment-index="8">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#1a5fb4;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35152"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="77.078339"
|
||||
y="12.246182" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="80.744095"
|
||||
y="21.563271"
|
||||
id="text18936"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan18934"
|
||||
style="stroke-width:0.264583"
|
||||
x="80.744095"
|
||||
y="21.563271">73</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35183"
|
||||
class="fragment fade-out"
|
||||
data-fragment-index="10">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#1a5fb4;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35156"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="98.244995"
|
||||
y="12.246182" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="101.98517"
|
||||
y="21.563271"
|
||||
id="text20054"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan20052"
|
||||
style="stroke-width:0.264583"
|
||||
x="101.98517"
|
||||
y="21.563271">95</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35208"
|
||||
class="fragment fade-out"
|
||||
data-fragment-index="1">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#e01b24;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect9472"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="13.578336"
|
||||
y="29.946056" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="17.186216"
|
||||
y="39.225937"
|
||||
id="text23358"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan23356"
|
||||
style="stroke-width:0.264583"
|
||||
x="17.186216"
|
||||
y="39.225937">15</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35203"
|
||||
class="fragment fade-out"
|
||||
data-fragment-index="3">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#e01b24;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35146"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="34.745003"
|
||||
y="29.946056" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="38.461746"
|
||||
y="39.263145"
|
||||
id="text24858"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan24856"
|
||||
style="stroke-width:0.264583"
|
||||
x="38.461746"
|
||||
y="39.263145">31</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35198"
|
||||
class="fragment fade-out"
|
||||
data-fragment-index="5">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#e01b24;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35150"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="55.911674"
|
||||
y="29.946056" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="59.611885"
|
||||
y="39.225937"
|
||||
id="text28932"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan28930"
|
||||
style="stroke-width:0.264583"
|
||||
x="59.611885"
|
||||
y="39.225937">55</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35193"
|
||||
class="fragment fade-out"
|
||||
data-fragment-index="6">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#e01b24;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35154"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="77.078339"
|
||||
y="29.946056" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="80.812996"
|
||||
y="39.263145"
|
||||
id="text31312"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan31310"
|
||||
style="stroke-width:0.264583"
|
||||
x="80.812996"
|
||||
y="39.263145">61</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35188"
|
||||
class="fragment fade-out"
|
||||
data-fragment-index="9">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#e01b24;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35158"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="98.244995"
|
||||
y="29.946056" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="101.91764"
|
||||
y="39.263145"
|
||||
id="text33274"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan33272"
|
||||
style="stroke-width:0.264583"
|
||||
x="101.91764"
|
||||
y="39.263145">88</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35216"
|
||||
transform="matrix(0.52216234,0,0,0.52216234,4.5423624,35.117642)"
|
||||
class="fragment"
|
||||
data-fragment-index="1">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#e01b24;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35210"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="13.578336"
|
||||
y="29.946056" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="17.186216"
|
||||
y="39.225937"
|
||||
id="text35214"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan35212"
|
||||
style="stroke-width:0.264583"
|
||||
x="17.186216"
|
||||
y="39.225937">15</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35224"
|
||||
transform="matrix(0.52216232,0,0,0.52216223,15.125698,44.359851)"
|
||||
class="fragment"
|
||||
data-fragment-index="2">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#1a5fb4;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35218"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="13.578336"
|
||||
y="12.246182" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="17.201374"
|
||||
y="21.603233"
|
||||
id="text35222"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan35220"
|
||||
style="stroke-width:0.264583"
|
||||
x="17.201374"
|
||||
y="21.603233">24</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35232"
|
||||
transform="matrix(0.52216231,0,0,0.5221623,14.656596,35.117644)"
|
||||
class="fragment"
|
||||
data-fragment-index="3">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#e01b24;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35226"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="34.745003"
|
||||
y="29.946056" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="38.461746"
|
||||
y="39.263145"
|
||||
id="text35230"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan35228"
|
||||
style="stroke-width:0.264583"
|
||||
x="38.461746"
|
||||
y="39.263145">31</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35240"
|
||||
transform="matrix(0.52216233,0,0,0.52216221,25.239929,44.359852)"
|
||||
class="fragment"
|
||||
data-fragment-index="4">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#1a5fb4;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35234"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="34.745003"
|
||||
y="12.246182" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="38.442455"
|
||||
y="21.563271"
|
||||
id="text35238"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan35236"
|
||||
style="stroke-width:0.264583"
|
||||
x="38.442455"
|
||||
y="21.563271">37</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35248"
|
||||
transform="matrix(0.52216234,0,0,0.52216234,24.770824,35.117643)"
|
||||
class="fragment"
|
||||
data-fragment-index="5">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#e01b24;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35242"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="55.911674"
|
||||
y="29.946056" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="59.611885"
|
||||
y="39.225937"
|
||||
id="text35246"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan35244"
|
||||
style="stroke-width:0.264583"
|
||||
x="59.611885"
|
||||
y="39.225937">55</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35256"
|
||||
transform="matrix(0.52216235,0,0,0.52216237,24.301722,35.117641)"
|
||||
class="fragment"
|
||||
data-fragment-index="6">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#e01b24;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35250"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="77.078339"
|
||||
y="29.946056" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="80.812996"
|
||||
y="39.263145"
|
||||
id="text35254"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan35252"
|
||||
style="stroke-width:0.264583"
|
||||
x="80.812996"
|
||||
y="39.263145">61</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35264"
|
||||
transform="matrix(0.52216235,0,0,0.52216229,45.937491,44.35985)"
|
||||
class="fragment"
|
||||
data-fragment-index="7">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#1a5fb4;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35258"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="55.911674"
|
||||
y="12.246182" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="59.668385"
|
||||
y="21.563271"
|
||||
id="text35262"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan35260"
|
||||
style="stroke-width:0.264583"
|
||||
x="59.668385"
|
||||
y="21.563271">62</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35272"
|
||||
transform="matrix(0.52216233,0,0,0.52216231,45.468392,44.35985)"
|
||||
class="fragment"
|
||||
data-fragment-index="8">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#1a5fb4;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35266"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="77.078339"
|
||||
y="12.246182" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="80.744095"
|
||||
y="21.563271"
|
||||
id="text35270"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan35268"
|
||||
style="stroke-width:0.264583"
|
||||
x="80.744095"
|
||||
y="21.563271">73</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35280"
|
||||
transform="matrix(0.52216231,0,0,0.52216238,44.999297,35.117641)"
|
||||
class="fragment"
|
||||
data-fragment-index="9">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#e01b24;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35274"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="98.244995"
|
||||
y="29.946056" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="101.91764"
|
||||
y="39.263145"
|
||||
id="text35278"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan35276"
|
||||
style="stroke-width:0.264583"
|
||||
x="101.91764"
|
||||
y="39.263145">88</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g35288"
|
||||
transform="matrix(0.52216234,0,0,0.52216225,55.582627,44.359851)"
|
||||
class="fragment"
|
||||
data-fragment-index="10">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#1a5fb4;stroke-width:1.5;stroke-linejoin:round;stroke-dashoffset:26.1543"
|
||||
id="rect35282"
|
||||
width="14.52487"
|
||||
height="14.52487"
|
||||
x="98.244995"
|
||||
y="12.246182" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:5.64444px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
|
||||
x="101.98517"
|
||||
y="21.563271"
|
||||
id="text35286"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan35284"
|
||||
style="stroke-width:0.264583"
|
||||
x="101.98517"
|
||||
y="21.563271">95</tspan></text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 19 KiB |
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 78 KiB |
|
@ -0,0 +1,309 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="149.0323mm"
|
||||
height="7.7762818mm"
|
||||
viewBox="0 0 149.0323 7.7762818"
|
||||
version="1.1"
|
||||
id="svg5"
|
||||
sodipodi:docname="merge_sort_onestep.svg"
|
||||
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview7"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:document-units="mm"
|
||||
showgrid="false"
|
||||
inkscape:zoom="1.3469645"
|
||||
inkscape:cx="260.58592"
|
||||
inkscape:cy="-5.9392803"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1011"
|
||||
inkscape:window-x="1080"
|
||||
inkscape:window-y="352"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1" />
|
||||
<defs
|
||||
id="defs2">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient1948">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop1944" />
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop1946" />
|
||||
</linearGradient>
|
||||
<filter
|
||||
inkscape:label="Pointillism"
|
||||
style="color-interpolation-filters:sRGB"
|
||||
inkscape:menu-tooltip="Gives a turbulent pointillist HSL sensitive transparency"
|
||||
inkscape:menu="Scatter"
|
||||
height="1.2680876"
|
||||
width="1.0069088"
|
||||
y="-0.13404382"
|
||||
x="-0.0034544142"
|
||||
id="filter1186">
|
||||
<feTurbulence
|
||||
seed="50"
|
||||
type="fractalNoise"
|
||||
baseFrequency="1"
|
||||
numOctaves="3"
|
||||
result="result1"
|
||||
id="feTurbulence1168" />
|
||||
<feColorMatrix
|
||||
type="luminanceToAlpha"
|
||||
in="SourceGraphic"
|
||||
result="result0"
|
||||
id="feColorMatrix1170" />
|
||||
<feColorMatrix
|
||||
result="result2"
|
||||
values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.5 0 "
|
||||
id="feColorMatrix1172" />
|
||||
<feComposite
|
||||
result="result3"
|
||||
operator="over"
|
||||
in="result1"
|
||||
in2="result2"
|
||||
id="feComposite1174" />
|
||||
<feColorMatrix
|
||||
result="result91"
|
||||
values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 5 -3.2"
|
||||
id="feColorMatrix1176" />
|
||||
<feComposite
|
||||
in2="result91"
|
||||
operator="arithmetic"
|
||||
k1="1.5"
|
||||
result="result93"
|
||||
id="feComposite1178"
|
||||
k2="0"
|
||||
k3="0"
|
||||
k4="0" />
|
||||
<feComposite
|
||||
in2="result93"
|
||||
in="SourceGraphic"
|
||||
operator="out"
|
||||
result="result4"
|
||||
id="feComposite1180" />
|
||||
<feComposite
|
||||
in2="result4"
|
||||
operator="arithmetic"
|
||||
k2="0.5"
|
||||
k1="1"
|
||||
id="feComposite1182"
|
||||
k3="0"
|
||||
k4="0" />
|
||||
<feDisplacementMap
|
||||
scale="15"
|
||||
xChannelSelector="R"
|
||||
yChannelSelector="A"
|
||||
in2="result1"
|
||||
result="fbSourceGraphic"
|
||||
id="feDisplacementMap1184" />
|
||||
<feColorMatrix
|
||||
result="fbSourceGraphicAlpha"
|
||||
in="fbSourceGraphic"
|
||||
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
|
||||
id="feColorMatrix1290" />
|
||||
<feTurbulence
|
||||
id="feTurbulence1292"
|
||||
seed="50"
|
||||
type="fractalNoise"
|
||||
baseFrequency="1"
|
||||
numOctaves="3"
|
||||
result="result1" />
|
||||
<feColorMatrix
|
||||
id="feColorMatrix1294"
|
||||
type="luminanceToAlpha"
|
||||
in="fbSourceGraphic"
|
||||
result="result0" />
|
||||
<feColorMatrix
|
||||
id="feColorMatrix1296"
|
||||
result="result2"
|
||||
values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.5 0 " />
|
||||
<feComposite
|
||||
in2="result2"
|
||||
id="feComposite1298"
|
||||
result="result3"
|
||||
operator="over"
|
||||
in="result1" />
|
||||
<feColorMatrix
|
||||
id="feColorMatrix1300"
|
||||
result="result91"
|
||||
values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 5 -3.2" />
|
||||
<feComposite
|
||||
in2="result91"
|
||||
id="feComposite1302"
|
||||
operator="arithmetic"
|
||||
k1="1.5"
|
||||
result="result93"
|
||||
k2="0"
|
||||
k3="0"
|
||||
k4="0" />
|
||||
<feComposite
|
||||
in2="result93"
|
||||
id="feComposite1304"
|
||||
in="fbSourceGraphic"
|
||||
operator="out"
|
||||
result="result4" />
|
||||
<feComposite
|
||||
in2="result4"
|
||||
id="feComposite1306"
|
||||
operator="arithmetic"
|
||||
k2="0.5"
|
||||
k1="1"
|
||||
result="result94"
|
||||
k3="0"
|
||||
k4="0" />
|
||||
<feDisplacementMap
|
||||
in2="result1"
|
||||
id="feDisplacementMap1308"
|
||||
scale="15"
|
||||
xChannelSelector="R"
|
||||
yChannelSelector="A"
|
||||
result="fbSourceGraphic" />
|
||||
<feColorMatrix
|
||||
result="fbSourceGraphicAlpha"
|
||||
in="fbSourceGraphic"
|
||||
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
|
||||
id="feColorMatrix1328" />
|
||||
<feTurbulence
|
||||
id="feTurbulence1330"
|
||||
seed="50"
|
||||
type="fractalNoise"
|
||||
baseFrequency="1"
|
||||
numOctaves="3"
|
||||
result="result1" />
|
||||
<feColorMatrix
|
||||
id="feColorMatrix1332"
|
||||
type="luminanceToAlpha"
|
||||
in="fbSourceGraphic"
|
||||
result="result0" />
|
||||
<feColorMatrix
|
||||
id="feColorMatrix1334"
|
||||
result="result2"
|
||||
values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.5 0 " />
|
||||
<feComposite
|
||||
in2="result2"
|
||||
id="feComposite1336"
|
||||
result="result3"
|
||||
operator="over"
|
||||
in="result1" />
|
||||
<feColorMatrix
|
||||
id="feColorMatrix1338"
|
||||
result="result91"
|
||||
values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 5 -3.2" />
|
||||
<feComposite
|
||||
in2="result91"
|
||||
id="feComposite1340"
|
||||
operator="arithmetic"
|
||||
k1="1.5"
|
||||
result="result93"
|
||||
k2="0"
|
||||
k3="0"
|
||||
k4="0" />
|
||||
<feComposite
|
||||
in2="result93"
|
||||
id="feComposite1342"
|
||||
in="fbSourceGraphic"
|
||||
operator="out"
|
||||
result="result4" />
|
||||
<feComposite
|
||||
in2="result4"
|
||||
id="feComposite1344"
|
||||
operator="arithmetic"
|
||||
k2="0.5"
|
||||
k1="1"
|
||||
result="result95"
|
||||
k3="0"
|
||||
k4="0" />
|
||||
<feDisplacementMap
|
||||
in2="result1"
|
||||
id="feDisplacementMap1346"
|
||||
scale="15"
|
||||
xChannelSelector="R"
|
||||
yChannelSelector="A"
|
||||
result="result92" />
|
||||
</filter>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient1948"
|
||||
id="linearGradient1950"
|
||||
x1="26.627516"
|
||||
y1="52.606476"
|
||||
x2="98.745148"
|
||||
y2="52.606476"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.99726795,0,0,1.445486,0.17126191,-22.59205)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient1948"
|
||||
id="linearGradient2226"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.99726795,0,0,1.445486,73.150196,-22.59205)"
|
||||
x1="26.627516"
|
||||
y1="52.606476"
|
||||
x2="98.745148"
|
||||
y2="52.606476" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient1948"
|
||||
id="linearGradient2350"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(2.0431409,0,0,1.442448,-29.788266,-22.937414)"
|
||||
x1="26.627516"
|
||||
y1="52.606476"
|
||||
x2="98.745148"
|
||||
y2="52.606476" />
|
||||
</defs>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-23.772593,-46.263108)">
|
||||
<rect
|
||||
style="fill:#000000;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-dashoffset:26.1543;filter:url(#filter1186)"
|
||||
id="rect846"
|
||||
width="144.74234"
|
||||
height="3.7301235"
|
||||
x="26.786331"
|
||||
y="48.717541" />
|
||||
<rect
|
||||
style="fill:url(#linearGradient1950);fill-opacity:1;stroke:#ffffff;stroke-width:1.17903;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:26.1543"
|
||||
id="rect1609"
|
||||
width="71.920601"
|
||||
height="5.8509712"
|
||||
x="26.72603"
|
||||
y="47.598904"
|
||||
class="fragment" />
|
||||
<rect
|
||||
style="fill:url(#linearGradient2226);fill-opacity:1;stroke:#ffffff;stroke-width:1.17903;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:26.1543"
|
||||
id="rect2224"
|
||||
width="71.920601"
|
||||
height="5.8509712"
|
||||
x="99.704964"
|
||||
y="47.598904"
|
||||
class="fragment" />
|
||||
<rect
|
||||
style="fill:url(#linearGradient2350);fill-opacity:1;stroke:#ffffff;stroke-width:1.68582;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:26.1543"
|
||||
id="rect2228"
|
||||
width="147.34648"
|
||||
height="5.8386741"
|
||||
x="24.615503"
|
||||
y="47.106018"
|
||||
class="fragment" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 8.9 KiB |
|
@ -0,0 +1,352 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="215.38005mm"
|
||||
height="125.25452mm"
|
||||
viewBox="0 0 215.38005 125.25452"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
|
||||
sodipodi:docname="Lecture 11-Recursion Tree.svg">
|
||||
<defs
|
||||
id="defs2">
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="marker1239"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto"
|
||||
inkscape:stockid="Arrow1Lend"
|
||||
inkscape:isstock="true">
|
||||
<path
|
||||
transform="matrix(-0.8,0,0,-0.8,-10,0)"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
id="path1237" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="Arrow1Lend"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto"
|
||||
inkscape:stockid="Arrow1Lend"
|
||||
inkscape:isstock="true"
|
||||
inkscape:collect="always">
|
||||
<path
|
||||
transform="matrix(-0.8,0,0,-0.8,-10,0)"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
id="path950" />
|
||||
</marker>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.7"
|
||||
inkscape:cx="382.14498"
|
||||
inkscape:cy="126.5521"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
inkscape:document-rotation="0"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1043"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(29.07805,-16.257893)">
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M -16.982352,135.9867 H 96.000045"
|
||||
id="path1295"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<circle
|
||||
style="fill:#000000;stroke:#000000;stroke-width:1"
|
||||
id="path833"
|
||||
cx="98.116386"
|
||||
cy="25.212076"
|
||||
r="2.4680669" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
||||
x="102.2294"
|
||||
y="24.288385"
|
||||
id="text837"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan835"
|
||||
x="102.2294"
|
||||
y="24.288385"
|
||||
style="stroke-width:0.264583">Θ(n)</tspan></text>
|
||||
<circle
|
||||
style="fill:#000000;stroke:#000000;stroke-width:1"
|
||||
id="circle839"
|
||||
cx="63.720554"
|
||||
cy="56.962082"
|
||||
r="2.4680669" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
||||
x="31.321089"
|
||||
y="56.038391"
|
||||
id="text843"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan841"
|
||||
x="31.321089"
|
||||
y="56.038391"
|
||||
style="stroke-width:0.264583">Θ(<tspan
|
||||
style="font-size:65%;baseline-shift:super"
|
||||
id="tspan845">n</tspan>/<tspan
|
||||
style="font-size:65%;baseline-shift:sub"
|
||||
id="tspan847">2</tspan>)</tspan></text>
|
||||
<circle
|
||||
style="fill:#000000;stroke:#000000;stroke-width:1"
|
||||
id="circle849"
|
||||
cx="132.51221"
|
||||
cy="56.962082"
|
||||
r="2.4680669" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
||||
x="138.21274"
|
||||
y="56.038391"
|
||||
id="text857"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan855"
|
||||
x="138.21274"
|
||||
y="56.038391"
|
||||
style="stroke-width:0.264583">Θ(<tspan
|
||||
style="font-size:65%;baseline-shift:super"
|
||||
id="tspan851">n</tspan>/<tspan
|
||||
style="font-size:65%;baseline-shift:sub"
|
||||
id="tspan853">2</tspan>)</tspan></text>
|
||||
<circle
|
||||
style="fill:#000000;stroke:#000000;stroke-width:1"
|
||||
id="circle859"
|
||||
cx="42.553886"
|
||||
cy="94.003738"
|
||||
r="2.4680669" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
||||
x="10.154423"
|
||||
y="93.080055"
|
||||
id="text867"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan865"
|
||||
x="10.154423"
|
||||
y="93.080055"
|
||||
style="stroke-width:0.264583">Θ(<tspan
|
||||
style="font-size:65%;baseline-shift:super"
|
||||
id="tspan861">n</tspan>/<tspan
|
||||
style="font-size:65%;baseline-shift:sub"
|
||||
id="tspan863">4</tspan>)</tspan></text>
|
||||
<circle
|
||||
style="fill:#000000;stroke:#000000;stroke-width:1"
|
||||
id="circle869"
|
||||
cx="84.887215"
|
||||
cy="94.003738"
|
||||
r="2.4680669" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
||||
x="52.487759"
|
||||
y="93.080055"
|
||||
id="text877"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan875"
|
||||
x="52.487759"
|
||||
y="93.080055"
|
||||
style="stroke-width:0.264583">Θ(<tspan
|
||||
style="font-size:65%;baseline-shift:super"
|
||||
id="tspan871">n</tspan>/<tspan
|
||||
style="font-size:65%;baseline-shift:sub"
|
||||
id="tspan873">4</tspan>)</tspan></text>
|
||||
<circle
|
||||
style="fill:#000000;stroke:#000000;stroke-width:1"
|
||||
id="circle879"
|
||||
cx="111.34554"
|
||||
cy="94.003738"
|
||||
r="2.4680669" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
||||
x="115.98775"
|
||||
y="93.080055"
|
||||
id="text887"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan885"
|
||||
x="115.98775"
|
||||
y="93.080055"
|
||||
style="stroke-width:0.264583">Θ(<tspan
|
||||
style="font-size:65%;baseline-shift:super"
|
||||
id="tspan881">n</tspan>/<tspan
|
||||
style="font-size:65%;baseline-shift:sub"
|
||||
id="tspan883">4</tspan>)</tspan></text>
|
||||
<circle
|
||||
style="fill:#000000;stroke:#000000;stroke-width:1"
|
||||
id="circle889"
|
||||
cx="153.67889"
|
||||
cy="94.003738"
|
||||
r="2.4680669" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
||||
x="158.32111"
|
||||
y="93.080055"
|
||||
id="text897"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan895"
|
||||
x="158.32111"
|
||||
y="93.080055"
|
||||
style="stroke-width:0.264583">Θ(<tspan
|
||||
style="font-size:65%;baseline-shift:super"
|
||||
id="tspan891">n</tspan>/<tspan
|
||||
style="font-size:65%;baseline-shift:sub"
|
||||
id="tspan893">4</tspan>)</tspan></text>
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 97.366496,25.33214 64.392119,56.935716"
|
||||
id="path899" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 98.953993,25.33214 131.44858,56.481567"
|
||||
id="path901"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 133.34983,57.611309 19.99923,36.672899"
|
||||
id="path903"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 131.65321,57.611309 111.65398,94.284208"
|
||||
id="path905"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 64.558141,57.611309 84.557359,94.284208"
|
||||
id="path907"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 62.861524,57.611309 42.862303,94.284208"
|
||||
id="path909"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 41.694856,95.182142 32.278968,131.85503"
|
||||
id="path911"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 43.391469,95.182142 9.415888,36.672888"
|
||||
id="path913"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 84.028192,95.182142 74.612304,131.85503"
|
||||
id="path915"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 85.724805,95.182142 9.415888,36.672888"
|
||||
id="path917"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 110.48653,95.182142 -9.41589,36.672888"
|
||||
id="path919"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 112.18315,95.182142 9.41589,36.672888"
|
||||
id="path921"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 152.81989,95.182142 143.404,131.85503"
|
||||
id="path923"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 154.51651,95.182142 9.41589,36.672888"
|
||||
id="path925"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#999999;stroke-width:1"
|
||||
id="rect931"
|
||||
width="142.07918"
|
||||
height="15.939964"
|
||||
x="26.828928"
|
||||
y="125.07246" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
||||
x="95.140694"
|
||||
y="133.97166"
|
||||
id="text935"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan933"
|
||||
x="95.140694"
|
||||
y="133.97166"
|
||||
style="stroke-width:0.264583">...</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
||||
x="-12.337652"
|
||||
y="76.055298"
|
||||
id="text939"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan937"
|
||||
x="-12.337653"
|
||||
y="76.055298"
|
||||
style="text-align:center;text-anchor:middle;stroke-width:0.264583">log<tspan
|
||||
style="font-size:65%;baseline-shift:sub"
|
||||
id="tspan943">2</tspan>(n)</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="-12.337652"
|
||||
y="89.284424"
|
||||
style="text-align:center;text-anchor:middle;stroke-width:0.264583"
|
||||
id="tspan941">height</tspan></text>
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)"
|
||||
d="M -11.690685,64.667886 V 25.390846"
|
||||
id="path945" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker1239)"
|
||||
d="M -11.690685,95.857668 V 135.13471"
|
||||
id="path1235" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M -16.982352,25.390846 H 96.000045"
|
||||
id="path1293"
|
||||
sodipodi:nodetypes="cc" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 13 KiB |
Loading…
Reference in New Issue