## Find the probability of a state at a given time in a Markov chain | Set 1

Given a Markov chain G, we have the find the probability of reaching the state F at time t = T if we start from… Read More »

Given a Markov chain G, we have the find the probability of reaching the state F at time t = T if we start from… Read More »

Given a rooted tree and not necessarily binary. The tree contains N nodes, labeled 1 to N. You are given the tree in the form… Read More »

Given a boolean 2D matrix. The task is to find the number of distinct islands where a group of connected 1s (horizontally or vertically) forms… Read More »

Given a m x n matrix of positive integers. The task is to find the number of paths from the top left of the matrix… Read More »

Consider a directed graph given in below, DFS of the below graph is 1 2 4 6 3 5 7 8. In below diagram if… Read More »

Given a Binary tree, Traverse it using DFS using recursion. Unlike linear data structures (Array, Linked List, Queues, Stacks, etc) which have only one logical… Read More »

Given an undirected and unweighted graph. The task is to find the product of the lengths of all cycles formed in it. Example 1: The… Read More »

Given a Binary Tree and a Level. The task is to find the node with the maximum value at that given level. Recommended: Please try… Read More »

Given a tree of N nodes and N-1 edges. Also given an integer M and a node, the task is to print the M-th node… Read More »

Given a tree of N nodes and N-1 edges. The task is to print the DFS of the subtree of a given node for multiple… Read More »

Given an undirected graph, print all the vertices that form cycles in it. Pre-requisite: Detect Cycle in a directed graph using colors In the above… Read More »

Given a graph, the task is to print the DFS traversal of a graph which includes the every step including the backtracking. 1st step:- 0… Read More »

Given an array of words, find any alphabetical order in the English alphabet such that the given words can be considered sorted (increasing), if there… Read More »

Graphs can be used for seemingly unconnected problems. Say the problem of cards which have numbers on both side and you try to create a… Read More »

Given a connected graph, check if the graph is bipartite or not. A bipartite graph is possible if the graph coloring is possible using two… Read More »