ProDeveloperTutorialonJanuary 19, 2025 Get the maximum sum of values of nodes among all connected components of an undirected graph Problem Statement: You are given an undirected graph with connected components. Every node has a value assigned to it. You need to get the…
ProDeveloperTutorialonJanuary 19, 2025 Find there is a path between 2 nodes in a directed graph Problem Statement: You are given a directed graph and 2 nodes. You need to find if there is a path between those two nodes. Solution We use…
ProDeveloperTutorialonJanuary 19, 2025 Given an directed graph, find the in and out degree of all vertices Problem Statement: You are given an directed graph, you need to find out the in and out degree of all the vertiecs. Example Vertex In Out 0 0…
ProDeveloperTutorialonJanuary 19, 2025 Check if the undirected graph is a tree or not Problem Statement: You are given a undirected graph. You need to see of that graph is a tree or not? Example Solution A graph can be a tree if…
ProDeveloperTutorialonJanuary 19, 2025 Given a directed graph, check if the incoming edges of a vertex is equal to the vertex itself. Problem Statement: You are given a directed graph, you need to check if the incoming edges of a vertex is equal to the vertex itself. Example…
ProDeveloperTutorialonJanuary 19, 2025 Reverse a directed graph Problem Statement: You are given an directed graph. You need to reverse the direction of the graph. Example Solution We will take another…
ProDeveloperTutorialonJanuary 19, 2025 Count the number of connected components in an undirected graph Problem Statement: You are given an undirected graph. YOu need to find out the number of connected componenets in taht graph. Example Output:…
ProDeveloperTutorialonJanuary 19, 2025 Check if undirected graph is connected or not Problem Statement: You are given an undirected graph. You need to check if it is connected or not. Example Solution In the above image, the…
ProDeveloperTutorialonJanuary 19, 2025 Check if the given edge is a bridge in the graph Problem Statement: You are given a graph and an edge, you need to check if that edge is a bridge. Example Solution An edge is called a bridge,…
ProDeveloperTutorialonJanuary 19, 2025 Strings: Longest Prefix Suffix Problem Statement: You are given a string, you need to find the length of longest proper perfix which is also a suffix. Example Example 1: str…