##
Minimum steps to reach target by a Knight
February 19, 2017

Given a square chessboard of N x N size, the position of Knight and position of a target is given. We need to find out… Read More »

February 19, 2017

Given a square chessboard of N x N size, the position of Knight and position of a target is given. We need to find out… Read More »

February 18, 2017

Reverse Delete algorithm is closely related to Kruskal’s algorithm. In Kruskal’s algorithm what we do is : Sort edges by increasing order of their weights.… Read More »

Given an undirected graph and an edge, the task is to find if the given edge is a bridge in graph, i.e., removing the edge… Read More »

February 1, 2017

If a graph is a complete graph with n vertices, then total number of spanning trees is n(n-2) where n is the number of nodes… Read More »

Chinese Postman Problem is a variation of Eulerian circuit problem for undirected graphs. An Euler Circuit is a closed walk that covers every edge once… Read More »

January 22, 2017

Given a directed Eulerian graph, print an Euler circuit. Euler circuit is a path that traverses every edge of a graph, and the path ends… Read More »

January 20, 2017

In Set 1, unweighted graph is discussed. In this post, weighted graph representation using STL is discussed. The implementation is for adjacency list representation of… Read More »

January 19, 2017

We have introduced Graph basics in Graph and its representations. In this post, a different STL based representation is used that can be helpful to… Read More »

January 9, 2017

Given a positive number k and an undirected graph of N nodes, numbered from 0 to N-1, each having a weight associated with it. Note… Read More »

January 6, 2017

Given an array arr[0..n-1] of positive and negative numbers we need to find if there is a cycle in array with given rules of movements.… Read More »

December 19, 2016

A Clique is a subgraph of graph such that all vertcies in subgraph are completely connected with each other. Given a Graph, find if it… Read More »

December 12, 2016

Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and connects all the vertices together.… Read More »

December 9, 2016

Given a two dimensional grid, each cell of which contains integer cost which represents a cost to traverse through that cell, we need to find… Read More »

December 7, 2016

Given an array of strings, find if the given strings can be chained to form a circle.

November 23, 2016

Given a initial number x and two operations which are given below: Multiply number by 2. Subtract 1 from the number. The task is to… Read More »