Memorizing computer science algorithms

Let’s assume in addition to quick sort, there will also be merge sort, bubble sort, etc… now what exactly are you planning on memorizing, if I may ask?

Any decent IDE has code completion these days, so it’s very different from using a text editor. Secondly, any half decent language will let you do array.sort() or array.sorted() in some sort of way. There is really no need in knowing how to type out the algorithm.

Also, if I hired you and you started typing out your own sorting routine for the kind of trivial problems Coursera most likely discussed, we’d need to have a talk. These days, there is extremely rarely the need for someone to write their own sorting routine.

There is however a need to understand the performance differences of the three aforementioned algorithms: on average, best case, and worst case. Really you should be able to answer why this list:

2, 5, 7, 9, 11, 17

is fasted sorted by a bubble sort and not a quick sort, even though quick sort outperforms bubble sort on average any day of the week.

First things first… there is no need to memorize pseudo code for an algorithm you don’t understand. Can you actually describe in your own words how a quick sort works? Because if you can, I don’t understand how you’d have trouble memorizing the algorithm because clearly, you already know it.

Also have a look here in case this is not the book you are using for the course… this is the standard text at most good universities.