Category Archives: Data strcuctures and algorithms

Data Structures and Algorithms in Python – Graphs

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 »

Implemeting Data Structures and Algorithms in Python: Problems and solutions

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 »