This repository provides my interpretation and playground of several important algorithms found in the chapters of Algorithms 4th Edition by Professors Sedgewick and Wayne to Python and matplotlib.
Why Algorithms and Python? There are many great languages out there. I especially like C++ because it was the first I learned. There are two main reasons why I chose to do this exercise: Algorithms are always intellectually demanding, and I like solving them to be a better problem solver. I need to admit my undergrad history with algorithms was not happy. I was not interested and just took the exams to pass the course. However, as far as I started to move to graduate programs, all topics interested to me (computer vision, numerical computing) have at least one of those critical algorithms within it. Also, I was training for a Facebook interview (I screwed it up :| ). I am a firm believer in learning by doing without the use of magical libraries. So, once I've got the book, the decision was a go-to for me. Second is that it was an opportunity to refresh Python, but also, learn matplotlib and compare it with ggplot (my main graphics library during my Ph.D. studies). By implementing yourself these algorithms I can assure that you become not only a better problem-solver but also a better programmer.
What worked? Well of course, this book is one of the best there is in this area. The complementary web page and Coursera's course are also great. Professor Sedgewick also seems to me, one of the most skilled professors to teach this complex topic. I loved how he mentioned some points about the algorithm's history and those romantic things that I started to love now I am becoming older.
What was hard? Beyond the algorithmic side and the challenge, I face when I try to solve string-type problems (need mor practice). I find NumPy to list conversion a little inorganic for Python; also, graphics syntaxis is not as fluent as in R if you come from the grammar of graphics styles (tydiverse, ggplot, d3js) Visualization I have made use of plain matplotlib, so no special library is required. It was really worth doing it and made it easy to plot the graphs. This made me learn and discover python capabilities, although I still prefer the grammar of graphics style of ggplot.
Chapter 5 string is far from being finished due to time constraints. In all of the chapters, the book has used its own graphics library whereas I have used pure matplotlib everywhere. Because I do not want copyright issues, you can get all testing files at https://algs4.cs.princeton.edu/home/
Good coding 😊