Graph Implementation – Adjacency list We’ve used dictionaries to implement the adjacency list in Python which is the easiest way. To implement Graph ADT we’ll create two classes, Graph, which holds the master list of vertices, and Vertex, which will represent each vertex in the graph. Each Vertex uses a dictionary to keep track of… Read More »
Bubble Sort Implementation The bubble sort makes multiple passes through a list. It compares adjacent items and exchanges those that are out of order. Each pass through the list places the next largest value in its proper place. In essence, each item “bubbles” up to the location where it belongs. Regardless of how the items… Read More »
Recently I have started using Python in a lot of places including writing algorithms for MI/data science, so I thought to try to implement some common programming problems using data structures in Python. As I have mostly implemented in C/C++ and Perl. Let’s get started with a very basic problem. Anagram algorithm An algorithm will… Read More »
Choropleth maps are a great way to represent geographical data. I have done a basic implementation of two different data sets. I have used jupyter notebook to show the plots. World Power Consumption 2014 First do Plotly imports import plotly.graph_objs as go from plotly.offline import init_notebook_mode,iplot init_notebook_mode(connected=True) Next step is to fetch the dataset, we’ll use… Read More »
Now a days people keep asking which technology stack to be used for web development (LAMP, Java, Microsoft) and finally which programming language mainly server-side. Most of the expert says that use whichever you like and comfortable and I totally agree. If you intend to use Java and Microsoft based env then you don’t have… Read More »
A real time comparison. Long live Perl. http://silicainsilico.wordpress.com/2012/03/26/switching-from-perl-to-python-speed/ Update: Adding another comparison between various programming languages including Perl. This is bit old post but still relevant. http://tenser.typepad.com/tenser_said_the_tensor/2006/08/python_vs_perl_.html Don’t forget to read comments.