Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: How to best teach algorithms and data structures?
40 points by dattl on Oct 11, 2018 | hide | past | favorite | 4 comments
In my opinion, what makes algorithms and data structures course so difficult is that it requires a lot of intuition in analyzing problems and designing algorithms.

Are there any good resources or tips in teaching (and tutoring)?

Here's what I try to do:

1. Start with the intuition. (The big concepts i.e. for BigO trying to figure out the best, worst and average number of steps it takes to run a function as the input size grows). Make sure everyone gets the big picture, core concepts, and intuition before moving on.

2. Use as many graphics and visual aids as possible.

3. Let people work step-wise up to getting the full solution i.e. get them to just sort one element in a list. Then change the algorithm to sort two elements, etc..

4. Start very easy, I mean very easy (like sorting a list of 1,2 and then 3 elements), then let people slowly step up in difficulty until they implement full algorithms and data structures. Also make sure everyone can at least describe, draw, and sketch out solutions that may not necessarily be precise but cover the "gist" of what the algorithm is about.

5. Use Stories: If you can tell them stories with algorithms / data structures its even better. (For stacks I like using the example of the professor grading essays on his desk, or a person browsing the internet, for binary search I like looking for a book in the library, etc)

6. Use Lots of Examples: When explaining the mathematics be sure to have exercises/examples which let them play a lot with the parameters (RStudio or jupyter is nice for this), make sure each expression is clearly broken down and clarified. Also having positive examples (for how it should work) and negative examples (for common mistakes and when things are incorrect) can help improve understanding too.

hope some of these tips help. Good luck!

I absolutely LOVE the book "Grokking Algorithms: An illustrated guide for programmers and other curious people" (http://adit.io/posts/2016-05-25-Grokking-Algorithms-Is-Out.h...) by Aditya Bhargava.

If the name sounds familiar, it might because of some of his other work which includes great explanations about the M word (http://adit.io/posts/2013-04-17-functors,_applicatives,_and_..., http://adit.io/posts/2013-06-10-three-useful-monads.html).

My favorite materials, one is The Design and Analysis of Algorithms by Kozen, which explains theory.

My second favorite is this free draft[1] parallel and sequential algorithms book, which uses a language based analysis method to allow things like garbage collection and dispatching to be better analyzed than traditional analysis. So a very good resource would combine the theory to explain what really is going on and the practical, how to apply the theory to more abstract algorithms we use everyday like garbage collection, geared to whatever the level of experience the reader has.

So something like the intuitive guide to data structures[2] but with more theory and addresses the problems of traditional analysis explained in [1].



maybe take a look how he teaches: https://www.coursera.org/learn/algorithms-part1

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact