What does it mean to know an algorithm? I thought I had known quicksort by years, but then I realized I couldn't implement it without looking to other sources. I then found that there are quite a few different implementations, for example (IMO) quicksort is a composite algorithm and what I mean by that is there are different partitioning algorithms that can be used. The only two I know of are Hoare and Lomuto. Out of curiosity does anyone know any others?
How do you actually learn a full implementation of an algorithm? For example so well that you can reproduce it on an interview. I worked at tracing variables by hand on a piece of paper and running the program in my head. What I found is I was memorizing the lines of code, however I don't feel like I have an intuitive understanding of the algorithm.