Algorithms
and
Data
Structures

Spring 2021
course
site
-->

May 10

... start recording

Questions?

Please do connect with one of the tutors or me to discuss your final project, if only for rubber duck debugging.

aside 1 : python syntax and conventions

It looks like most of you are working with python for your final projects. (C would be another reasonable choice.) If so, I will be paying attention to standard practices within that language including

This stuff matters because code is read by people (like me and you), not just computers. So it pays to make your code readable. Look at any of my python code to get an idea of what I like.

aside 2 : csv files

example : "people.csv"

name,address,phone
John Smith,"123 Somewhere, Someplace",8023805969
Jane Doe,"777 North Pole Drive, Transylvania",6660001234

If your project is generating or consuming data, that could be a reasonable format for it.

SQL example

Let's work through a registrar.sql example, along the lines of what what I asked you to do for homework.

--- registrar.sql
---
--- A demo SQL database
--- 
---   +-----------------+ 
---   |  Student        |
---   |-----------------|
---   |  id             |
---   |  name           |
---   +-----------------+
---            |
---            |
---           /|\
---   +-----------------+
---   |  Registration   |
---   |-----------------|
---   |  id             |
---   |  course_id      |
---   |  student_id     |
---   |  date           |
---   +-----------------+
---           \|/
---            |
---            |
---      +----------+
---      |  Course  |
---      |----------|
---      |  id      |
---      |  name    |
---      |  blurb   |
---      +----------+
---
--- exercise :
---       
---       What courses has River taken?
---       Express the question as a SQL query, in two ways :
---          (a) using JOIN
---          (b) using subqueries


(After we try this in class, here's my answer .)

aside 3 :

complexity theory and all that

In our next excursion into a few other interesting topics as we wind down the term, and as you all work on your final projects, I'd like us to read about and discuss a few "big picture" ideas related to algorithms. There won't be as many "write this code" problems here, but instead hopefully give you some context for the sorts of questions that computer scientists study. If you continue on with this stuff, this would be a kind of "coming attractions."

I've put up some complexity notes which can be a starting point for an overview of these topics.