No video

Cycle Detection for Directed and Undirected Graphs in Java | Check if a Graph has a Cycle | Geekific

  Рет қаралды 3,400

Geekific

Geekific

Күн бұрын

Support us on Patreon: / geekific
Discord Community: / discord
GitHub Repository: github.com/geekific-official/
In our previous videos, we covered what graphs are, how many types of graphs we have, and we’ve learned a few graph traversal algorithms and techniques. In this video we focus on cyclic graphs, both directed and undirected. More specifically, we’ll see how to detect, in code, if any of these graph types contains a cycle.
Timestamps:
00:00 Introduction
00:28 What are Cycles?
01:13 Detecting a Cycle in a Directed Graph
03:33 Cycle Detection for Directed Graphs Implementation
07:12 Detecting a Cycle in a Undirected Graph
09:26 Thanks for Watching!
If you found this video helpful, check other Geekific uploads:
- Object-Oriented Programming Fundamentals: • What is Object-Oriente...
- SOLID Principles and Best Practices: • SOLID Design Principle...
- Recursion Made Simple, Recursive Methods: • What is Recursion? | R...
- Use-Case and Sequence Diagrams: • UML Use-Case and Seque...
- Graphs, The Fundamentals: • Introduction to Graphs...
- Trees Compared and Visualized, BST vs AVL vs Red-Black vs Splay vs Heaps: • Trees Compared and Vis...
- Dijkstra's Algorithm Explained and Implemented in Java: • Shortest Path | Dijkst...
- Ford-Fulkerson Algorithm Explained and Implemented in Java: • Max Flow | Ford-Fulker...
- Generics and Wildcards in Java, Invariance vs Covariance vs Contravariance: • Generics and Wildcards...
#Geekific #CycleDetection #GraphTheory #DFS #BFS

Пікірлер: 4
@tomasalves5182
@tomasalves5182 8 ай бұрын
Thanks, i've been searching for hours but only this did the trick, thank you so much
@tedelamater
@tedelamater Жыл бұрын
I feel like BFS is easier to find cycles.
@manOfPlanetEarth
@manOfPlanetEarth Жыл бұрын
Niiiice!!! One small remark. Boolean "onCurrentPath" instead of "beingVisited" would be more reflecting what's going on:) We have multiple being visited vertices in the path under exploring while function "hasCycle" at every moment works with only one vertex. It confuses. Even boolean "green" would be more self-telling:) 2. As I get your "stream branded" approach is not applicable here because of need to return value (boolean), is it? Thank you for the material🥳
@geekific
@geekific Жыл бұрын
Glad I could help :) and 2-Yup.
Graph -13: Check if Directed Graph has Cycle (Using DFS)
26:03
Coding Simplified
Рет қаралды 9 М.
لقد سرقت حلوى القطن بشكل خفي لأصنع مصاصة🤫😎
00:33
Cool Tool SHORTS Arabic
Рет қаралды 29 МЛН
Lehanga 🤣 #comedy #funny
00:31
Micky Makeover
Рет қаралды 18 МЛН
The hidden beauty of the A* algorithm
19:22
polylog
Рет қаралды 852 М.
Breadth First Search (BFS): Visualized and Explained
10:41
Reducible
Рет қаралды 197 М.
لقد سرقت حلوى القطن بشكل خفي لأصنع مصاصة🤫😎
00:33
Cool Tool SHORTS Arabic
Рет қаралды 29 МЛН