arrow_upward
How to remember basic sorting algorithms?
#1
the code is confusing to remember, especially trying to keep track of indexes and pivots.



#2
Don't try to memorize the code line for line. Try to understand the concept and the mechanism behind the algorithm. If you understand that you'll be able to re-piece it back together.

Is this for an interview? If it's general use just google it when you need Big Grin



#3
Yea.. understanding how it works tends to be better easy to put the code together



#4
The names of the algorithms should be descriptive enough to remind you what they are meant to do
Insertion sort inserts
bubble sort bubbles up
selection sort selects the right element
...
quick sort is quick xD



#5
If you dont know what you're doing, then even remembering line for line isnt going to help. Just try to understand how everything works so it's easier to recall. Besides theres no fun in just remembering.