Quick search for answers to ‘Introduction to Algorithms’

Inspired byAutomate the Boring Stuff with Pythonby Al Sweigart , I thought of putting it to some good use for my college based course.

We all know how essential is the knowledge of Data Structure and Algorithms for anyone interested in Computer Science.The Bible of this domain is ‘Introduction to Algorithms by Thomas H. Cormen ,‎ Charles E. Leiserson ,‎ Ronald L. Rivest and‎ Clifford Stein. It’s a very detailed book, yet for a beginner and someone who is not so confident in Mathematics (like me), it becomes a daunting task to proceed even beyond the first few chapters. I searched online for solutions to the book and discovered this awesome website Introduction to algorithms- Study Group. It provides solutions to some of the chapters in different web-pages.

The front webpage of the website providing links to the answers.
Search results

I decided to make a simple search based application to sift through the various links to the exercises and problems of each chapter and display the appropriate solution for the question number asked.

I divided the whole task to two different programs.

  • IntroAlgoApp.py
  • FinderApp.py

IntroAlgoApp

  • Purpose : The aim of this code is to download the webpages and save them as local HTML files in the hard-drive. (This wasn’t necessary as the program could directly open the links to display the required answer. However, I felt having the webpages as local files will minimise the network data usage and independent of any internet network.) The HTML files were saved with appropriate names in a new folder at a designated place in the hard-drive.
  • Modules required : requests, bs4, os, sys
Executing IntroAlgoApp.py

FinderApp

  • Purpose : The aim of this code is to search for the appropriate file according to the question number in a default web browser (here IE 11).
  • Modules required : webbrowser, os
Executing FinderApp.py

CAUTION:

  • This doesn’t provide solution to all Chapters.
  • — contains chapters 1 to 11 and C only.
  • The author of the solutions has written in the website’s About page that there lies the possibility of some errors in the solution.

The idea to turn it into a desktop application is under consideration. Let me know through comments and claps what you feel and would you like the desktop application to be made. Hope you enjoyed my first story at Medium.

--

--

Coder, Amateur Musician, Blogger

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store