## Union-Find Algorithm for Cycle Detection in a graph

Given an connected graph, find if it contains any cycle or not using Union-Find algorithm.

## Check if given Graph is Strongly Connected or not

Given a directed graph, check if it is strongly connected or not. A directed graphs is said to be strongly connected if every vertex is reachable from every other vertex.

## Chess Knight Problem | Find Shortest path from source to destination

Given a chess board, find the shortest distance (minimum number of steps) taken by a Knight to reach given destination from given source.

## Disjoint-Set Data Structure (Union Find Algorithm)

Explain the working of disjoint-set data structure and efficiently implement it.   Problem: We have some number of items. We are allowed to merge any two items to consider them equal. At any point, we are allowed to ask whether two items are considered equal or not.

## Check if given digraph is a DAG (Directed Acyclic Graph) or not

Given an directed graph, check if it is a DAG (Directed Acyclic Graph) or not. A DAG is a digraph (directed graph) that contains no cycles.

## 2-Vertex Connectivity in the graph

Given a undirected connected graph, check if the graph is 2-vertex connected or not.   A connected graph G is said to be 2-vertex-connected (or 2-connected) if it has more than 2 vertices and remains connected on removal of any vertices. Any such vertex whose removal will disconnected the graph is called Articulation point.

## 2-Edge Connectivity in a Graph

Given a undirected connected graph, check if the graph is 2-edge connected or not.

## Determine if an undirected graph is a Tree (Acyclic Connected Graph)

Given an undirected graph, check if is is a tree or not. In other words, check if given undirected graph is a Acyclic Connected Graph or not.

## Total number of paths in given digraph from given source to destination having exactly m edges

Given a digraph (Directed Graph), find the total number of routes to reach the destination from given source that have exactly m edges.

## Check if an undirected graph contains cycle or not

Given an connected undirected graph, find if it contains any cycle or not.

## Convert HashMap to TreeMap in Java

In this post, we will see how to convert HashMap to TreeMap in Java. The resultant TreeMap should contain all mappings of the HashMap, sorted by their natural ordering of keys.

## Transitive Closure of a Graph

Given a digraph G, the transitive closure is a digraph G’ such that (i, j) is an edge in G’ if there is a directed path from i to j in G. The resultant digraph G’ representation in form of adjacency matrix is called the connectivity matrix.