##
A matrix probability question
June 1, 2016

Given a rectangular matrix, we can move from current cell in 4 directions with equal probability. The 4 directions are right, left, top or bottom.… Read More »

June 1, 2016

Given a rectangular matrix, we can move from current cell in 4 directions with equal probability. The 4 directions are right, left, top or bottom.… Read More »

May 19, 2016

There are two common ways to traverse a graph, BFS and DFS. Considering a Tree (or Graph) of huge height and width, both BFS and… Read More »

May 16, 2016

Given an undirected, connected and weighted graph, find Minimum Spanning Tree (MST) of the graph using Kruskal’s algorithm. Input : Graph as an array of… Read More »

May 1, 2016

Given a graph, a source vertex in the graph and a number k, find if there is a simple path (without any cycle) starting from… Read More »

April 11, 2016

Dijkstra’s shortest path algorithm runs in O(Elog V) time when implemented with adjacency list representation (See C implementation and STL based C++ implementations for details).… Read More »

April 10, 2016

We strongly recommend to refer below article before moving on to this article. Push Relabel Algorithm | Set 1 (Introduction and Illustration) Problem Statement :… Read More »

April 5, 2016

Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge uv, vertex u comes before v… Read More »

April 4, 2016

Given a graph which represents a flow network where every edge has a capacity. Also given two vertices source ‘s’ and sink ‘t’ in the… Read More »

March 28, 2016

What is a Mother Vertex? A mother vertex in a graph G = (V,E) is a vertex v such that all other vertices in G… Read More »

March 26, 2016

Given a graph G and an integer K, K-cores of the graph are connected components that are left after all vertices of degree less than… Read More »

March 23, 2016

March 22, 2016

Given an undirected, connected and weighted graph, find Minimum Spanning Tree (MST) of the graph using Prim’s algorithm. Input : Adjacency List representation of above… Read More »

March 21, 2016

Given a graph and a source vertex in graph, find shortest paths from source to all vertices in the given graph. Input : Source =… Read More »

March 20, 2016

March 13, 2016

Given a graph and a source vertex in graph, find shortest paths from source to all vertices in the given graph. We have discussed Dijkstra’s… Read More »