Skip to content

Commit 9a787fa

Browse files
authored
Update cs3003-unit4-examples.md.html
added bubble and quicksort
1 parent 874da15 commit 9a787fa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

notes/cs3003-unit4-examples.md.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,12 +592,20 @@ <h1 id="epilogue">Epilogue</h1>
592592
<h2 id="verbose-compare">Verbose Compare</h2>
593593
<p><img src="http://bit.ly/sortVerbose" alt="verbose"></p>
594594
<h2 id="python-pseudo-code-compare">Python Pseudo Code Compare</h2>
595+
<p><strong>UPDATE: May 30, 2022</strong><br>
596+
<em>Added bubblesort (for AD3251)</em><br>
597+
<img src="https://i.imgur.com/wXqaMty.png" alt="bubble"></p>
595598
<ul>
596599
<li>insertionsort : get a key and <strong>insert</strong> it into <em>sorted</em> sublist</li>
597600
<li>selectionsort : <strong>select</strong> minimum value and swap into <em>sorted</em> sublist</li>
598601
<li>mergesort : divide and <strong>merge</strong> (<em>conquer</em>) of <em>sorted</em> sublists</li>
599602
</ul>
600603
<p><img src="http://bit.ly/sortCompared2" alt="sortCode"></p>
604+
<p><strong>UPDATE: May 30, 2022</strong><br>
605+
<em>Added quicksort (for AD3251)</em><br>
606+
<img src="https://i.imgur.com/dGztZZe.png" alt="qsort"></p>
607+
<p>With the <code>partition</code> function:<br>
608+
<img src="https://i.imgur.com/1LVSfeW.png" alt="qsort2"></p>
601609
<h2 id="helper-functions">Helper functions</h2>
602610
<p>Three helper functions (<code>insort</code>, <code>min_index</code> and <code>merge</code>) were written and used in the respective sorting implementation.</p>
603611
<p>These helper functions are very effective in capturing the core of each of the algorithm. Also, they help in presenting the algorithm in an incremental fashion, reducing the cognitive load on the student.</p>

0 commit comments

Comments
 (0)