how to understand algorithms