Memorizing computer science algorithms

Lol… fair enough, more power to you. I just wanted to point out why that whole exercise may not be as beneficial as you might imagine.

That’s not really what I’m saying… of course you should “know how to,” but why would that mean memorizing pseudo code? Pseudo code is just one way, I could also ask you to give it to me as a flow chart OR check your conceptional understanding (see first post) asking you when a quick sort that normally outperforms a bubble sort wouldn’t do so. Maybe I’ll just simply give you a list and ask you to write down what it looks like in the next iteration.

See my point above… I’d see you actually drawing exactly “that” on the board though… not the pseudocode of the algorithm. Anyways… on to your question…

Well yeah… story method or place the individual steps in a memory palace. Really up to you…

Think about that for a second… most algorithms can be visualized easily as the steps that they perform, so unless you want to memorize the algorithm in a particular language there isn’t much need to visualize things as other things.

Which proves my point… let’s simply take line 2 from above:

Some languages use // or /* */ instead of #, so what are we doing here… especially, once we consider that it’s used to mark a comment… don’t tell me that you need to know where inside the pseudo code comments go is important.

DItto for [ and ] because not all languages use that notation for subscripts. I could also write the pseudo code as A_l if that’s possible. Certainly possible with pen and paper… and on this forum I can do it by writing A_l and putting it inside of $s but that’s not the point. That line simply says:

Place the \color{blue}value that is in position \color{red}l in the array \color{red}A into a variable called \color{blue}p.

What you need is an image for your variable and an image that represent a certain array at a certain subscript position. The individual letters are obviously not chosen randomly, so that shouldn’t be much of an issue.

So if that’s what you want to do, that is how I’d approach it. Also, if you do need mathematical notation, just use braille instead of making up your own like suggested above. There are a few standards in braille and there is no need to reinvent the wheel for that… plus you can just use the images from your binary system… I’ve written about it here:

1 Like