Skip to main content

C'est la Z

Category: data structures

When will I need to know this, Data Structures edition

One of the things we're frequently faced with as computer science teachers is the questiosn of "when will I need to know this." This comes up when you teach an non-mainstream language like Racket or a language kids sometimes see as inauthentic like Scratch. It also comes up a lot when learning data structures and algorithms. Do I really need to know all of these sorts when I'm just going to use the built in sort routine?


Continuing with the theme of alternate representations we just started heaps. Specifically binary heaps. binary min and max heaps. Heaps are one of my favorite topics in CS2. If you're not familiar with them, a binary min heap is a complete binary tree that enforces the heap property. By being complete we mean that every level except possibly the last one is full - that is 2 children. The last level is as filled left to right.

Alternate Representations

There was a comment on my last post about arbitary trees on Reddit talking about how this type of data structure was a hold over from the old days when computer resources were more limited. Nowadays having a list of children makes more sense. The comment was of course correct but I still think it's worth teaching representations like the one I spoke of in my last post. Looking at interesting and different ways of representing data and modeling solutions is one of the things that separates programmers or coders from computer scientists and software engineers.

Arbitrary Trees

It's been 10 days from my last post. Not really a big break for me historically but certainly a big one given how much I've been posting this year. Been under the weather for the past couple of weeks dealing with COVID-19. Haven't had super bad symptoms and as symptoms have been getting fewer and less severe I'm hoping I'm close to a full recovery. In any event, I'm feeling good enough for a quick post.