Skip to content

Commit

Permalink
Wed Oct 23 12:33:12 PDT 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
papajohn committed Oct 23, 2024
1 parent 6df9166 commit 14bf999
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 15 deletions.
Binary file added assets/pdfs/c88c-mt-study-guide.pdf
Binary file not shown.
Binary file added assets/slides/16-Data_Examples_1pp.pdf
Binary file not shown.
95 changes: 95 additions & 0 deletions assets/slides/16.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
from link import *


def length(s):
"""Return the number of elements in linked list s.
>>> length(Link(3, Link(4, Link(5))))
3
"""
if s is Link.empty:
return 0
else:
return 1 + length(s.rest)

def length_iter(s):
"""Return the number of elements in linked list s.
>>> length_iter(Link(3, Link(4, Link(5))))
3
"""
k = 0
while s is not Link.empty:
s, k = s.rest, k + 1
return k

def append(s, x):
"""Append x to the end of non-empty s and return None.
>>> s = Link(3, Link(4, Link(5)))
>>> append(s, 6)
>>> print(s)
<3 4 5 6>
"""
if s.rest:
append(s.rest, x)
else:
s.rest = Link(x)

def append_iter(s, x):
"""Append x to the end of non-empty s and return None.
>>> s = Link(3, Link(4, Link(5)))
>>> append_iter(s, 6)
>>> print(s)
<3 4 5 6>
"""
while s.rest:
s = s.rest
s.rest = Link(x)


def pop(s, i):
"""Remove and return element i from linked list s for positive i.
>>> t = Link(3, Link(4, Link(5, Link(6))))
>>> pop(t, 2)
5
>>> pop(t, 2)
6
>>> pop(t, 1)
4
>>> t
Link(3)
"""
assert i > 0 and i < length(s)
for x in range(i-1):
s = s.rest
result = s.rest.first
s.rest = s.rest.rest
return result


def range_link(start, end):
"""Return a Link containing consecutive integers from start to end.
>>> range_link(3, 6)
Link(3, Link(4, Link(5)))
"""
if start >= end:
return Link.empty
else:
return Link(start, range_link(start + 1, end))

def range_link_iter(start, end):
"""Return a Link containing consecutive integers from start to end.
>>> range_link_iter(3, 6)
Link(3, Link(4, Link(5)))
"""
s = Link.empty
k = end - 1
while k >= start:
s = Link(k, s)
k -= 1
return s
63 changes: 48 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,37 @@ <h1>Data C88C: Computational Structures in Data Science</h1>
<section id="announcements">

<div class="announcement" id='announcement-0' style='display:block;'>
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Wednesday, October 23</h2>
<!-- <div><a href="#calendar_10_23">Jump to date</a></div> -->
<ul>
<li>Homework 7 is due Wednesday 10/23 @ 11:59pm and has only 2 required questions.</li>
<li><p>The Midterm is Wednesday 10/30 8pm-10pm.</p>

<ul>
<li>Arrive by 8pm to find your seat; the exam will start at 8:10pm.</li>
<li>Seat assignments will be emailed to you before the exam (probably Tuesday)</li>
<li>Complete the alteration request form (coming very soon) by Sunday, 10/27 at 11:59pm for any seating/timing requests (including DSP students).</li>
<li>The exam covers material in the videos through Monday 10/21 (Linked Lists).</li>
<li>You may bring up to 2 2-sided sheets of notes.</li>
<li>The <a href="https://c88c.org/fa24/assets/pdfs/c88c-mt-study-guide.pdf">midterm study guide</a> will be printed for you and provided with your exam.</li>
<li>Practice exam questions are <a href="https://edstem.org/us/courses/63975/discussion/5559340">on Ed here</a>.</li>
</ul></li>
<li><p>The Ants project is due Wednesday 11/20 @ 11:59pm.</p>

<ul>
<li>Nothing is due before the Midterm on 10/30 (so you could wait to do this project).</li>
<li>Checkpoint 1 due Wednesday 11/6.</li>
<li>Checkpoint 2 due Wednesday 11/13.</li>
<li>Get an early submission bonus point for submitting by Tuesday 11/19!</li>
</ul></li>
</ul>

</div>


<div class="announcement" id='announcement-1' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Monday, October 21</h2>
Expand All @@ -172,7 +203,7 @@ <h2 class="frontpage-header">Announcements: Monday, October 21</h2>
</div>


<div class="announcement" id='announcement-1' >
<div class="announcement" id='announcement-2' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Wednesday, October 16</h2>
Expand All @@ -194,7 +225,7 @@ <h2 class="frontpage-header">Announcements: Wednesday, October 16</h2>
</div>


<div class="announcement" id='announcement-2' >
<div class="announcement" id='announcement-3' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Monday, October 14</h2>
Expand All @@ -211,7 +242,7 @@ <h2 class="frontpage-header">Announcements: Monday, October 14</h2>
</div>


<div class="announcement" id='announcement-3' >
<div class="announcement" id='announcement-4' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Wednesday, October 9</h2>
Expand All @@ -231,7 +262,7 @@ <h2 class="frontpage-header">Announcements: Wednesday, October 9</h2>
</div>


<div class="announcement" id='announcement-4' >
<div class="announcement" id='announcement-5' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Monday, October 7</h2>
Expand All @@ -252,7 +283,7 @@ <h2 class="frontpage-header">Announcements: Monday, October 7</h2>
</div>


<div class="announcement" id='announcement-5' >
<div class="announcement" id='announcement-6' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Wednesday, October 2</h2>
Expand Down Expand Up @@ -282,7 +313,7 @@ <h2 class="frontpage-header">Announcements: Wednesday, October 2</h2>
</div>


<div class="announcement" id='announcement-6' >
<div class="announcement" id='announcement-7' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Monday, September 30</h2>
Expand All @@ -303,7 +334,7 @@ <h2 class="frontpage-header">Announcements: Monday, September 30</h2>
</div>


<div class="announcement" id='announcement-7' >
<div class="announcement" id='announcement-8' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Wednesday, September 25</h2>
Expand All @@ -326,7 +357,7 @@ <h2 class="frontpage-header">Announcements: Wednesday, September 25</h2>
</div>


<div class="announcement" id='announcement-8' >
<div class="announcement" id='announcement-9' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Monday, September 23</h2>
Expand All @@ -338,7 +369,7 @@ <h2 class="frontpage-header">Announcements: Monday, September 23</h2>
</div>


<div class="announcement" id='announcement-9' >
<div class="announcement" id='announcement-10' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Wednesday, September 18</h2>
Expand All @@ -357,7 +388,7 @@ <h2 class="frontpage-header">Announcements: Wednesday, September 18</h2>
</div>


<div class="announcement" id='announcement-10' >
<div class="announcement" id='announcement-11' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Monday, September 16</h2>
Expand All @@ -375,7 +406,7 @@ <h2 class="frontpage-header">Announcements: Monday, September 16</h2>
</div>


<div class="announcement" id='announcement-11' >
<div class="announcement" id='announcement-12' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Wednesday, September 11</h2>
Expand All @@ -388,7 +419,7 @@ <h2 class="frontpage-header">Announcements: Wednesday, September 11</h2>
</div>


<div class="announcement" id='announcement-12' >
<div class="announcement" id='announcement-13' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Monday, September 9</h2>
Expand All @@ -401,7 +432,7 @@ <h2 class="frontpage-header">Announcements: Monday, September 9</h2>
</div>


<div class="announcement" id='announcement-13' >
<div class="announcement" id='announcement-14' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Wednesday, September 4</h2>
Expand All @@ -427,7 +458,7 @@ <h2 class="frontpage-header">Announcements: Wednesday, September 4</h2>
</div>


<div class="announcement" id='announcement-14' >
<div class="announcement" id='announcement-15' >
<button class="btn prev" style="color: black"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> older</button>
<button class="btn next" style="color: black"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> newer</button>
<h2 class="frontpage-header">Announcements: Monday, August 26</h2>
Expand Down Expand Up @@ -1181,6 +1212,8 @@ <h2 class="frontpage-header">Calendar</h2>

<ul class="list-inline">
<li><a href="https://www.youtube.com/watch?v=tpfpNR3u4zk&list=PL6BsET-8jgYXjF3p3z_exoHPdwPP7QyMy&ab_channel=JohnDeNero" class="label label-outline" target="_blank">Videos</a></li>
<li><a href="/fa24/assets/slides/16-Data_Examples_1pp.pdf" class="label label-outline">Slides (1pp)</a></li>
<li><a href="/fa24/assets/slides/16.py" class="label label-outline">16.py</a></li>
</ul>
</td>
<td>
Expand Down Expand Up @@ -1580,7 +1613,7 @@ <h3><a href="/articles/about">Policies</a></h3>

});

let build_time = new Date(1000 * 1729702478.218361);
let build_time = new Date(1000 * 1729711962.786486);
</script>
<script>
$('.alwaystoggle').css('display', 'inline-block');
Expand Down

0 comments on commit 14bf999

Please sign in to comment.