Skip to content

Commit db41c06

Browse files
committed
Website build
1 parent 60fe701 commit db41c06

File tree

3 files changed

+141
-16
lines changed

3 files changed

+141
-16
lines changed

5_abstract_data_types.html

Lines changed: 70 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,20 @@
9696
structures which could be used to implement them.</p>
9797
<div class="section" id="stacks">
9898
<span id="id2"></span><h2><span class="section-number">5.1. </span>Stacks<a class="headerlink" href="#stacks" title="Permalink to this headline"></a></h2>
99-
<p>Possibly the simplest abstract data type which is not synonymous with
99+
<details class="sphinx-bs dropdown card mb-3">
100+
<summary class="summary-title card-header">
101+
Video: stacks as an abstract data type.<div class="summary-down docutils">
102+
<svg version="1.1" width="24" height="24" class="octicon octicon-chevron-down" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M5.22 8.72a.75.75 0 000 1.06l6.25 6.25a.75.75 0 001.06 0l6.25-6.25a.75.75 0 00-1.06-1.06L12 14.44 6.28 8.72a.75.75 0 00-1.06 0z"></path></svg></div>
103+
<div class="summary-up docutils">
104+
<svg version="1.1" width="24" height="24" class="octicon octicon-chevron-up" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M18.78 15.28a.75.75 0 000-1.06l-6.25-6.25a.75.75 0 00-1.06 0l-6.25 6.25a.75.75 0 101.06 1.06L12 9.56l5.72 5.72a.75.75 0 001.06 0z"></path></svg></div>
105+
</summary><div class="summary-content card-body docutils">
106+
<div class="vimeo docutils container">
107+
<iframe src="https://player.vimeo.com/video/506479213"
108+
frameborder="0" allow="autoplay; fullscreen"
109+
allowfullscreen></iframe></div>
110+
<p class="card-text">Imperial students can also <a class="reference external" href="https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=b014e13a-82ca-4a57-ac7f-acc000e64349">watch this video on Panopto</a>.</p>
111+
</div>
112+
</details><p>Possibly the simplest abstract data type which is not synonymous with
100113
a Python type is the <a class="reference internal" href="#term-stack"><span class="xref std std-term">stack</span></a>. A stack is a sequence of objects
101114
in which only the most recently added object is accessible. The image
102115
to have in mind is a stack of plates on a spring-loaded holder of the
@@ -113,11 +126,6 @@
113126
the sequence. <a class="reference internal" href="#stackdiag"><span class="std std-numref">Fig. 5.1</span></a> shows these operations. It is also common to add an additional operation of
114127
<code class="xref py py-obj docutils literal notranslate"><span class="pre">peek</span></code>, which returns the most recently added object without removing
115128
it from the stack.</p>
116-
<div class="admonition note">
117-
<p class="admonition-title">Note</p>
118-
<p>The stack operations in the diagram are wrong. The stack is back to front and
119-
the wrong value is popped.</p>
120-
</div>
121129
<div class="figure align-default" id="id5">
122130
<span id="stackdiag"></span><div><svg height="740" viewBox="0 0 832 740" width="832" xmlns="http://www.w3.org/2000/svg" xmlns:inkspace="http://www.inkscape.org/namespaces/inkscape" xmlns:xlink="http://www.w3.org/1999/xlink">
123131
<defs id="defs_block">
@@ -387,7 +395,20 @@ <h2><span class="section-number">5.2. </span>Separation of concerns<a class="hea
387395
</div>
388396
<div class="section" id="algorithmic-complexity">
389397
<h2><span class="section-number">5.3. </span>Algorithmic complexity<a class="headerlink" href="#algorithmic-complexity" title="Permalink to this headline"></a></h2>
390-
<p>The second reason that understanding abstract data types is important
398+
<details class="sphinx-bs dropdown card mb-3">
399+
<summary class="summary-title card-header">
400+
Video: dynamic arrays and algorithmic complexity.<div class="summary-down docutils">
401+
<svg version="1.1" width="24" height="24" class="octicon octicon-chevron-down" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M5.22 8.72a.75.75 0 000 1.06l6.25 6.25a.75.75 0 001.06 0l6.25-6.25a.75.75 0 00-1.06-1.06L12 14.44 6.28 8.72a.75.75 0 00-1.06 0z"></path></svg></div>
402+
<div class="summary-up docutils">
403+
<svg version="1.1" width="24" height="24" class="octicon octicon-chevron-up" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M18.78 15.28a.75.75 0 000-1.06l-6.25-6.25a.75.75 0 00-1.06 0l-6.25 6.25a.75.75 0 101.06 1.06L12 9.56l5.72 5.72a.75.75 0 001.06 0z"></path></svg></div>
404+
</summary><div class="summary-content card-body docutils">
405+
<div class="vimeo docutils container">
406+
<iframe src="https://player.vimeo.com/video/506479208"
407+
frameborder="0" allow="autoplay; fullscreen"
408+
allowfullscreen></iframe></div>
409+
<p class="card-text">Imperial students can also <a class="reference external" href="https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=516115a0-b13d-4693-951b-acc000e642ff">watch this video on Panopto</a>.</p>
410+
</div>
411+
</details><p>The second reason that understanding abstract data types is important
391412
is that a good implementation of a well-designed abstract data type
392413
will have well-defined performance characteristics. In particular, the
393414
optimal algorithmic complexity, expressed in big <span class="math notranslate nohighlight">\(O\)</span> notation, of
@@ -648,7 +669,20 @@ <h3><span class="section-number">5.3.1. </span>Amortised complexity and worst ca
648669
</div>
649670
<div class="section" id="queues-and-deques">
650671
<h2><span class="section-number">5.4. </span>Queues and deques<a class="headerlink" href="#queues-and-deques" title="Permalink to this headline"></a></h2>
651-
<p>A <a class="reference internal" href="#term-queue"><span class="xref std std-term">queue</span></a> is, like a <a class="reference internal" href="#term-stack"><span class="xref std std-term">stack</span></a>, an ordered sequence of
672+
<details class="sphinx-bs dropdown card mb-3">
673+
<summary class="summary-title card-header">
674+
Video: deques and ring buffers.<div class="summary-down docutils">
675+
<svg version="1.1" width="24" height="24" class="octicon octicon-chevron-down" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M5.22 8.72a.75.75 0 000 1.06l6.25 6.25a.75.75 0 001.06 0l6.25-6.25a.75.75 0 00-1.06-1.06L12 14.44 6.28 8.72a.75.75 0 00-1.06 0z"></path></svg></div>
676+
<div class="summary-up docutils">
677+
<svg version="1.1" width="24" height="24" class="octicon octicon-chevron-up" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M18.78 15.28a.75.75 0 000-1.06l-6.25-6.25a.75.75 0 00-1.06 0l-6.25 6.25a.75.75 0 101.06 1.06L12 9.56l5.72 5.72a.75.75 0 001.06 0z"></path></svg></div>
678+
</summary><div class="summary-content card-body docutils">
679+
<div class="vimeo docutils container">
680+
<iframe src="https://player.vimeo.com/video/506710190"
681+
frameborder="0" allow="autoplay; fullscreen"
682+
allowfullscreen></iframe></div>
683+
<p class="card-text">Imperial students can also <a class="reference external" href="https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=5ba7fde3-8ca9-48e2-b66b-acc100bd1953">watch this video on Panopto</a>.</p>
684+
</div>
685+
</details><p>A <a class="reference internal" href="#term-queue"><span class="xref std std-term">queue</span></a> is, like a <a class="reference internal" href="#term-stack"><span class="xref std std-term">stack</span></a>, an ordered sequence of
652686
objects. The difference is that the only accessible item in the
653687
sequence is the <em>earliest</em> added. Items can be added to the back of
654688
the queue and taken from the front. As with a stack, the optimal
@@ -688,7 +722,20 @@ <h3><span class="section-number">5.4.1. </span>Ring buffers<a class="headerlink"
688722
</div>
689723
<div class="section" id="linked-lists">
690724
<h2><span class="section-number">5.5. </span>Linked lists<a class="headerlink" href="#linked-lists" title="Permalink to this headline"></a></h2>
691-
<p>One disadvantage of a deque (and hence of a stack or queue) is that inserting an
725+
<details class="sphinx-bs dropdown card mb-3">
726+
<summary class="summary-title card-header">
727+
Video: linked lists.<div class="summary-down docutils">
728+
<svg version="1.1" width="24" height="24" class="octicon octicon-chevron-down" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M5.22 8.72a.75.75 0 000 1.06l6.25 6.25a.75.75 0 001.06 0l6.25-6.25a.75.75 0 00-1.06-1.06L12 14.44 6.28 8.72a.75.75 0 00-1.06 0z"></path></svg></div>
729+
<div class="summary-up docutils">
730+
<svg version="1.1" width="24" height="24" class="octicon octicon-chevron-up" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M18.78 15.28a.75.75 0 000-1.06l-6.25-6.25a.75.75 0 00-1.06 0l-6.25 6.25a.75.75 0 101.06 1.06L12 9.56l5.72 5.72a.75.75 0 001.06 0z"></path></svg></div>
731+
</summary><div class="summary-content card-body docutils">
732+
<div class="vimeo docutils container">
733+
<iframe src="https://player.vimeo.com/video/506743244"
734+
frameborder="0" allow="autoplay; fullscreen"
735+
allowfullscreen></iframe></div>
736+
<p class="card-text">Imperial students can also <a class="reference external" href="https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=f37ae26c-a39a-4757-bc0d-acc100eec588">watch this video on Panopto</a>.</p>
737+
</div>
738+
</details><p>One disadvantage of a deque (and hence of a stack or queue) is that inserting an
692739
object into the middle of the sequence is often an <span class="math notranslate nohighlight">\(O(n)\)</span> operation,
693740
because on average half of the items in the sequence need to be shuffled to make
694741
space. A linked list provides a mechanism for avoiding this. A singly linked
@@ -842,7 +889,20 @@ <h2><span class="section-number">5.5. </span>Linked lists<a class="headerlink" h
842889
</div>
843890
<div class="section" id="the-iterator-protocol">
844891
<span id="iterator-protocol"></span><h2><span class="section-number">5.6. </span>The iterator protocol<a class="headerlink" href="#the-iterator-protocol" title="Permalink to this headline"></a></h2>
845-
<p>The abstract data types we have considered here are collections of
892+
<details class="sphinx-bs dropdown card mb-3">
893+
<summary class="summary-title card-header">
894+
Video: the iterator protocol.<div class="summary-down docutils">
895+
<svg version="1.1" width="24" height="24" class="octicon octicon-chevron-down" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M5.22 8.72a.75.75 0 000 1.06l6.25 6.25a.75.75 0 001.06 0l6.25-6.25a.75.75 0 00-1.06-1.06L12 14.44 6.28 8.72a.75.75 0 00-1.06 0z"></path></svg></div>
896+
<div class="summary-up docutils">
897+
<svg version="1.1" width="24" height="24" class="octicon octicon-chevron-up" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M18.78 15.28a.75.75 0 000-1.06l-6.25-6.25a.75.75 0 00-1.06 0l-6.25 6.25a.75.75 0 101.06 1.06L12 9.56l5.72 5.72a.75.75 0 001.06 0z"></path></svg></div>
898+
</summary><div class="summary-content card-body docutils">
899+
<div class="vimeo docutils container">
900+
<iframe src="https://player.vimeo.com/video/506743250"
901+
frameborder="0" allow="autoplay; fullscreen"
902+
allowfullscreen></iframe></div>
903+
<p class="card-text">Imperial students can also <a class="reference external" href="https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=d1b2b176-066a-4d68-aa01-acc100eec5c6">watch this video on Panopto</a>.</p>
904+
</div>
905+
</details><p>The abstract data types we have considered here are collections of
846906
objects, and one common abstract operation which is applicable to
847907
collections is to iterate over them. That is to say, to loop over the
848908
objects in the collection and perform some action for each one. This

_sources/5_abstract_data_types.rst.txt

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ structures which could be used to implement them.
3434
Stacks
3535
------
3636

37+
.. dropdown:: Video: stacks as an abstract data type.
38+
39+
.. container:: vimeo
40+
41+
.. raw:: html
42+
43+
<iframe src="https://player.vimeo.com/video/506479213"
44+
frameborder="0" allow="autoplay; fullscreen"
45+
allowfullscreen></iframe>
46+
47+
Imperial students can also `watch this video on Panopto
48+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=b014e13a-82ca-4a57-ac7f-acc000e64349>`__.
49+
50+
3751
Possibly the simplest abstract data type which is not synonymous with
3852
a Python type is the :term:`stack`. A stack is a sequence of objects
3953
in which only the most recently added object is accessible. The image
@@ -53,11 +67,6 @@ the sequence. :numref:`stackdiag` shows these operations. It is also common to a
5367
`peek`, which returns the most recently added object without removing
5468
it from the stack.
5569

56-
.. note::
57-
58-
The stack operations in the diagram are wrong. The stack is back to front and
59-
the wrong value is popped.
60-
6170
.. _stackdiag:
6271

6372
.. blockdiag::
@@ -274,6 +283,20 @@ tasks.
274283
Algorithmic complexity
275284
----------------------
276285

286+
.. dropdown:: Video: dynamic arrays and algorithmic complexity.
287+
288+
.. container:: vimeo
289+
290+
.. raw:: html
291+
292+
<iframe src="https://player.vimeo.com/video/506479208"
293+
frameborder="0" allow="autoplay; fullscreen"
294+
allowfullscreen></iframe>
295+
296+
Imperial students can also `watch this video on Panopto
297+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=516115a0-b13d-4693-951b-acc000e642ff>`__.
298+
299+
277300
The second reason that understanding abstract data types is important
278301
is that a good implementation of a well-designed abstract data type
279302
will have well-defined performance characteristics. In particular, the
@@ -535,6 +558,20 @@ this.
535558
Queues and deques
536559
-----------------
537560

561+
.. dropdown:: Video: deques and ring buffers.
562+
563+
.. container:: vimeo
564+
565+
.. raw:: html
566+
567+
<iframe src="https://player.vimeo.com/video/506710190"
568+
frameborder="0" allow="autoplay; fullscreen"
569+
allowfullscreen></iframe>
570+
571+
Imperial students can also `watch this video on Panopto
572+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=5ba7fde3-8ca9-48e2-b66b-acc100bd1953>`__.
573+
574+
538575
A :term:`queue` is, like a :term:`stack`, an ordered sequence of
539576
objects. The difference is that the only accessible item in the
540577
sequence is the *earliest* added. Items can be added to the back of
@@ -582,6 +619,20 @@ buffer.
582619
Linked lists
583620
------------
584621

622+
623+
.. dropdown:: Video: linked lists.
624+
625+
.. container:: vimeo
626+
627+
.. raw:: html
628+
629+
<iframe src="https://player.vimeo.com/video/506743244"
630+
frameborder="0" allow="autoplay; fullscreen"
631+
allowfullscreen></iframe>
632+
633+
Imperial students can also `watch this video on Panopto
634+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=f37ae26c-a39a-4757-bc0d-acc100eec588>`__.
635+
585636
One disadvantage of a deque (and hence of a stack or queue) is that inserting an
586637
object into the middle of the sequence is often an :math:`O(n)` operation,
587638
because on average half of the items in the sequence need to be shuffled to make
@@ -737,6 +788,20 @@ based on ring buffers.
737788
The iterator protocol
738789
---------------------
739790

791+
.. dropdown:: Video: the iterator protocol.
792+
793+
.. container:: vimeo
794+
795+
.. raw:: html
796+
797+
<iframe src="https://player.vimeo.com/video/506743250"
798+
frameborder="0" allow="autoplay; fullscreen"
799+
allowfullscreen></iframe>
800+
801+
Imperial students can also `watch this video on Panopto
802+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=d1b2b176-066a-4d68-aa01-acc100eec5c6>`__.
803+
804+
740805
The abstract data types we have considered here are collections of
741806
objects, and one common abstract operation which is applicable to
742807
collections is to iterate over them. That is to say, to loop over the

0 commit comments

Comments
 (0)