3 ms·
It is important if you ever plan on writing software that works well. For example, I am working on an application that draws routes on Google Maps. There are
by cullenking 17y ago
It is important if you ever plan on writing software that works well. For example, I am working on an application that draws routes on Google Maps. There are points that comprise the route, and the points have data associated with them. I wanted to be able to mouse over the map and have the nearest point on the route highlighted and populate a headsup display with the information it contained. This is a non-trivial problem to solve efficiently. You can do it the naive way and just linearly search all the points on the route on every mousemove event, however, that can be hundreds of thousands of comparisons a second for a long route. However, if you use an efficient data structure for multi-dimensional searching, like a k-d tree, you can find the point in 20 or so comparisons for a large route.
The best part is that data structures like a k-d tree are rarely covered in higher ed CS programs. However, if you have a core competency with algorithms and data structures, finding the appropriate data structure or algorithm and implementing it becomes so much easier.
Even the simplest data structures to implement, like a linked list, come in handy. In the same application, I had need for a linked list structure however flash has none. However it was trivial to cook up (after all the work on the k-d tree), and 30 minutes later I was in business.
stevecooperorg said it best: if you want to just glue crap together, then probably not. However, even "gluing things together" can be assisted by these concepts! My mapping application could be considered "gluing", however to do a novel job and make it more than the competition, you have to have the extra bit of knowledge.