Teaching Data Structures

Filed under: algorithm

Hello again reader. So glad you’re still reading my blog! I know, I’ve been very quiet over the past two months, was up to my ears in getting up to speed with a new challenge of teaching a data structures course at a local university on top of still working full time. Had found out about the week before classes started that I got the job, thankfully my employer was understanding to allow teaching. Getting acquainted with lecturing twice a week, every week, coming up with a grading scale for each assignment/exam was an ad-hoc process, learning a lot along the way and slowly getting settled in. Right now we’re about a bit after the midpoint of the semester. It’s a little over two months into the Fall semester and just under two more months left. Had to figure out a lot of things beyond the lectures, though arguably since it’s been nearly two decades since going into depth with this material preparing the lectures has been the most challenging. Today having signed the papers agreeing to teach again next semester, seemed like a good time to write about experiences thus far.

Brooklyn College Campus

Brooklyn College Campus


Table of Contents


Where I’m teaching

By “local university” in the above paragraph, I was referring to within the NYC county border, so within the 5 boroughs. Just about all the universities I can name off the top of my head are located off a subway stop so while it was possible for me to commute to teach by public transit, for me it means an hour commute by subway via express line from one part of a borough to another part. I’m teaching at CUNY Brooklyn College, which is a City University of New York (CUNY) senior college located right off the 2/5 stop at Flatbush. Beautiful campus, lovely people, interesting history. It’s got the largest CS program of all the CUNY campuses.

CUNY Campuses

CUNY Campuses

Background

My background with the field of Computer Science is quite long, would say we’ve had an on and off history over the last 20 years. I learned data structures and algorithms as an undergraduate CS student when Java was still in its infancy, version 3 or 41, right now for class we’re using version 8. Early 2000s was when Facebook and MySpace were first created. There was a lot about the world that I didn’t know about, there was a lot in the world that doesn’t exist yet2. 20 years is a long time in modern CS history. Data structures is a required course that appears on just about every curriculum for computer science students. It’s the course where you start to think about the design patterns in your programs. The design of a tangible object like a teapot or door handle is easy to explain why it’s good or bad. Organization of data/information is harder to articulate.

Because of a distinct lack of context surrounding the field of CS when I was learning it way back when, I felt it quite important to illustrate the importance of data structures and algorithms in society by bringing in a brief history lesson periodically into the classroom. All our work in programming today is standing on the shoulders of giants. Respect should be given where its due by passing on knowledge of the great figures who gave us the things that we still use today. Rather than sticking to a dry presentation of what is _this_ structure and how it operates that can be read from a textbook, I wanted to bring in my anthropological training to the classroom to talk about the cultural relevance and the motivation(s) that compelled the computer scientists of the past to create new data structures and algorithms. There’s a lot I need to learn/edit in so far as presenting my thoughts cohesively but like I said it’s been quite ad-hoc so far :smile:

Historical Context

In the first week of class, I introduced the beginning point of machine based computation. The Difference and Analytical Engine by Charles Babbage, the Turing Machine by Alan Turing, the history of calculating math and notating patterns of match with lambda calculus, the modern Computer Architecture by John von Neuman, and the evolutions of all the dialects of programming languages that share the theoretical principles of data structures and algorithms.

19th Century

20th Century

19th & 20th Century Computers

Cultural Relevance

Later on in the semester after going through simple sorting techniques on arrays and linked lists, I realized that it would be good to differentiate various operations that algorithms and data structures execute, for instance, sorting vs searching from the shape themselves. In the 1960s the whole world was facing changes in social and political issues as well as industrial shifts. We can see that Computer Science research also experienced radical shifts in the 60s.

I did some research to find out how the publication dates line up and because I could not find it illustrated, I drew these important dates (not drawn to scale) to show the evolution of non-linear data structures in the 60s. The “above” dates focus on the history of the shapes as I like to call them, to refer to the structures for organizing data. The “bottom” part show the evolution of important moments in history on sorting techniques.

Timeline

© Illustrated by katychuang for MacbookandHeels.com

Interview Prep

As I wrote on the slide itself, the history displayed is brief and incomplete. In addition to a historical lens, I also emphasize the importance of knowing enough of data structures and algorithms as preparation for job seeking as these are the topics being tested along with language fluency. That time may seem far away but creeps up on you real quick. While lectures contain more theoretical aspects, the class exercises and take home assignments are designed to be more akin to the things that might be found as real world experiences.

The first assignment was to test for a review of the java language. The second, some interview like questions, and now the third a project with many pieces, one part utilizing data structures to make meaning from a text file. I didn’t realize until the third assignment that students need explicit prodding to socially engage with each other. I encouraged them to work together, to discuss their implementations of the assignment objectives with each other and discuss reading of API docs with each other. Just a small handful of students took that upon themselves.

Hopefully by the end of this semester I’ll be able to successfully tie in both the hopes and dreams of the computer scientists of yore with practical skills that computer scientists of today need to know.

  1. looking at the wikipedia page on Java version history shows Java version 4 was a very long time ago ↩︎

  2. At the time of learning CS, I didn’t know yet about psychologies such as imposter syndrome or gender differences. There is definitely a strong contrast in reading the material as a teen vs now as an adult with considerably more experience as a published author/editor and having seen more problems solved via data structures and algorithms. I deviated to explore HCI, Health Informatics, and social computing for quite sometime before coming back to the roots. All these topics I’ll save for another day if anyone has interest, as the points I want to make today in this post is my perspectives on one of the core, fundamental topics in CS. ↩︎