## Number of Hamiltonian cycle

Given an undirected complete graph of N vertices where N > 2. The task is to find the number of different Hamiltonian cycle of the… Read More »

- Detect Cycle in a Directed Graph using BFS
- Print all the cycles in an undirected graph
- Samsung Semiconductor Institute of Research(SSIR Software) intern/FTE | Set-3
- Find the number of distinct islands in a 2D matrix
- Tree, Back, Edge and Cross Edges in DFS of Graph
- Kruskal's Algorithm (Simple Implementation for Adjacency Matrix)
- Dijkstra's shortest path with minimum edges
- Check if it is possible to reach a number by making jumps of two given length
- Maximum number of edges among all connected components of an undirected graph
- Level Ancestor Problem
- Minimum cost path from source node to destination node via an intermediate node
- Difference between graph and tree
- Jump Pointer Algorithm
- Coloring a Cycle Graph
- Find the ordering of tasks from given dependencies
- Johnson’s algorithm for All-pairs shortest paths | Implementation
- Shortest Path using Meet In The Middle
- Number of Walks from source to destination
- Graph Types and Applications
- Edge Coloring of a Graph
- Prim's Algorithm (Simple Implementation for Adjacency Matrix Representation)
- Find whether it is possible to finish all tasks or not from given dependencies
- Find maximum path length in a binary matrix
- Number of Isosceles triangles in a binary tree
- Unique paths covering every non-obstacle block exactly once in a grid
- Cost of painting n * m grid
- Minimum time to return array to its original state after given modifications
- Minimum steps required to convert X to Y where a binary matrix represents the possible conversions
- Minimum Operations to make value of all vertices of the tree Zero
- Total number of Spanning trees in a Cycle Graph

Given an undirected complete graph of N vertices where N > 2. The task is to find the number of different Hamiltonian cycle of the… Read More »

Given a directed graph and a node X. The task is to find the minimum number of edges that must be added to the graph… Read More »

Given a connected graph with N vertices and M edges. The task is to print the lexicographically smallest BFS traversal of the graph starting from… Read More »

Given an integer l and a tree represented as an undirected graph rooted at vertex 0. The task is to print the number of nodes… Read More »

Given an undirected graph of V nodes (V > 2) named V1, V2, V3, …, Vn. Two nodes Vi and Vj are connected to each… Read More »

Given an undirected graph G(V, E) with N vertices and M edges. We need to find the minimum number of edges between a given pair… Read More »

Given two integers n and m which are the dimensions of a grid. The task is to find the cost of painting the grid cell… Read More »

Given two integers N and M, the task is to count the number of simple undirected graphs that can be drawn with N vertices and… Read More »

Given a grid grid[][] with 4 types of blocks: 1 represents the starting block. There is exactly one starting block. 2 represents the ending block.… Read More »

Given an undirected graph with multiple connected components, the task is to clone the graph. Cloning a graph with a single connected component can be… Read More »

Given a starting position ‘k’ and two jump sizes ‘d1’ and ‘d2’, our task is to find the minimum number of jumps needed to reach… Read More »

Given an adjacency list representation of a directed graph, the task is to find the path from source to every other node in the graph… Read More »

Given a permutation P = p1, p2, …., pn of first n natural numbers (1 ≤ n ≤ 10). One can swap any two consecutive… Read More »

Depth First Search (DFS) marks all the vertices of a graph as visited. So for making DFS useful, some additional information can also be stored.… Read More »

Given a binary matrix of size NxN where 1 denotes that the number i can be converted to j, and 0 denotes it cannot be… Read More »