Following 2011f 6.006 MIT OCW course lectures, introduction to algorithms, Python scripts to go along with discussed problems and algorithmic solutions are posted here.
For each lecture, if a problem is provided with a corresponding solution discussed, a python script which implements the solution will be in Lec{X}.py, with documentation and appropriate doctests (though not necessarily faithful to the example values given by the professors). Python scripts are assumed to be in 3.9, so functionality may break on prior versions.
I will generally try to implement all of the algorithms with the following rules:
- Only consulting google / stackoverflow for general python help, and not with algorithm implementations
- Being faithful to the algorithmic complexities discussed. For instance, if an algorithm discussed in lecture is O(n), my solution will be O(n) (or better). Otherwise I will not post it.
- If I need to consult outside help, appropriate citation will be provided (as good practice as well as for didactic purposes)
Anyone who studies 6.006 on OCW may find this to be beneficial, but I will not create solutions to the posted problem sets, as that's generally frowned upon. Also, I cannot guarantee my implementations will be maximially optimal or even the best stylistically. I am an MIT student myself, and will be taking 6.006 in the following semester!
If anyone wants to follow this amazing course, you can find the playlist here --> https://www.youtube.com/watch?v=HtSuA80QTyo&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb or the OCW website --> https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/ Taught by Prof. Erik Demaine and Prof. Srini Devadas.
Kevin Bunn, 2021