##
Finding minimum vertex cover size of a graph using binary search
July 5, 2016

A vertex cover of an undirected graph is a subset of its vertices such that for every edge (u, v) of the graph, either ‘u’… Read More »

July 5, 2016

A vertex cover of an undirected graph is a subset of its vertices such that for every edge (u, v) of the graph, either ‘u’… Read More »

June 27, 2016

Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5… Read More »

June 15, 2016

Given a tree (not necessarily a binary tree) and a number of queries such that every query takes two nodes of tree as parameters. For… 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 »