Mike Mossey tutoring logo

USACO tutoring with Mike Mossey

Your USACO journey starts with a great teacher

Using pseudocode effectively

Girl taking the USACO exam

Pseudocode is high-level code

“Pseudocode” is a way of preparing to write code by writing approximate commands at a higher level than actual code. It’s one of the most critical tools for developing an algorithm when you’re unsure how to proceed.

I work with my students on learning pseudocode

There are actually many ways to write pseudocode, and some of them are more useful than others. One of the most valuable tools I can give my students is a better understanding of how to use pseudocode in a practical way.

An example of pseudocode

1: for every item I in the list L:
2:    compare I to every item in the list J
3:    if any are the same:
4:       add I to the set S

We can see that line 2 skips over quite a lot of detail—it would need a loop to fully implement—but it’s perfectly clear what’s going on.