Posts

Showing posts with the label Problem Solving

Learning data structures and algorithms

Image
When I say that you need to learn algorithms and data structures, what I really mean is: You Need to Learn Problems. No, you don’t need to memorize algorithms and data structures to the point where you can implement them on a whiteboard from memory. Nobody actually uses that skill, except during a job interview. If you want to write code at an exceptional level of talent, what you really need to do is: You Need to Learn Problems. First example for you. Let’s say that I have a large set of points in space. And then I choose an arbitrary point in space, and I say,  tell me, as quickly as you can, which k points in my set, are closest to this arbitrary point. Now you could have several responses to this question. One is to throw up your hands and have no idea where to start. Another is to simply compare the distance between every point in the set and the arbitrary point. If you did that, you should be able to sort that list by distance, and produce the k nearest