Problem: Implement the Kevin Bacon Game. This is a game where you can enter an actor and receive a response about how many movies you need to go through, before you a chain of co-actors where one of them is Kevin Bacon.
Do it with a graph.
Figure out what operations you need, what data structure you build, and then implement the functions!
Code WorkOut of the Day -- Daily exercises for programmers looking for jobs, or just to keep sharp with skills and have fun. I give talks, like this: https://youtu.be/NpvTE7GlXSM for people looking for jobs, or groups of programmers preparing for M&A tech HR due diligence. Follow us on twitter: @codewod
When solving these problems, learning by doing is much better than learning by reading. I encourage to you read only as far in the solution as you need, then trying to solve the problem. If you get stuck, try reading a little further. And of course, let me know if you find a better solution!
Monday, January 11, 2016
Subscribe to: Posts (Atom)