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…
ProDeveloperTutorialonJanuary 19, 2025 Design a stack that returns the minimum element in constant time. Problem Statement: You need to design a stack that returns the minimum element from the stack in constant time. Solution For solving this…
ProDeveloperTutorialonJanuary 19, 2025 Convert Postfix to Infix Problem Statement: Given an infix expression, convert into postfix expression. Infix expression: a op b Postfix expression: a b op Solution In…