filmov
tv
Graph - 10: Find if Source to Destination is reachable in Undirected Graph
![preview_player](https://i.ytimg.com/vi/a2VkK1zqheY/maxresdefault.jpg)
Показать описание
Solution:
- We'll achieve this via DFS approach.
- Take stack & boolean array
- Now when you start dfs from source index, it mark visited to all components to which it's connected to
- So via visted boolean array, we can identify if element is visited or not
- So at last return visited[destination_index]
Time Complexity: O(V + E)
CHECK OUT CODING SIMPLIFIED
★☆★ VIEW THE BLOG POST: ★☆★
I started my YouTube channel, Coding Simplified, during Dec of 2015.
Since then, I've published over 400+ videos.
★☆★ SUBSCRIBE TO ME ON YOUTUBE: ★☆★
★☆★ Send us mail at: ★☆★
- We'll achieve this via DFS approach.
- Take stack & boolean array
- Now when you start dfs from source index, it mark visited to all components to which it's connected to
- So via visted boolean array, we can identify if element is visited or not
- So at last return visited[destination_index]
Time Complexity: O(V + E)
CHECK OUT CODING SIMPLIFIED
★☆★ VIEW THE BLOG POST: ★☆★
I started my YouTube channel, Coding Simplified, during Dec of 2015.
Since then, I've published over 400+ videos.
★☆★ SUBSCRIBE TO ME ON YOUTUBE: ★☆★
★☆★ Send us mail at: ★☆★
Graph - 10: Find if Source to Destination is reachable in Undirected Graph
Functions: Determine if the graph is a function or not.
Evaluate a Function from a Graph
Find the Domain and Range from a Graph
How To Find The Equation of a Quadratic Function From a Graph
How To Find The Equation of a Line From a Graph | Algebra
Domain and Range of a Function From a Graph
Straight-Line Graphs: Find Gradient From Graph (m = Positive) (Grade 4) - GCSE Maths Revision
Find Least Line of Regression using Graph
Finding the Period and Amplitude of a Graph
Graph - 7: Check if Undirected Graph is Connected
Speed time graph (Acceleration and Total distance)
If The Point (3 4) Lies On The Graph Of The Equation 3y=ax+7 Find The Value Of a
How To Graph Horizontal and Vertical Lines
How to pick the best scale for a graph
Complete Graph Number of Edges
Velocity time graph
How to determine the degree and leading coefficient given the graph of a polynomial
Writing the equation from a graph
Graph a linear equation by the x and y intercepts
Given fx sketch the first and second derivative graph
Mr. S Algebra 1 Class Domain and Range Graph (08/29/22)
2023 Travel graph | Acceleration | Distance Problem.
Visualise any graph or tree with this tool instantly | #competitiveprogramming | #shorts
Комментарии