Code Explainers

Code explainers tagged #graphs

javascript
function depthFirstSearch(graph, start) {
  const visited = new Set();
  const order = [];
 

Depth-first search and pathfinding in JS

graphs recursion depth-first-search
Intermediate 8 steps
java
import java.util.*;
 
public class TopologicalSort {
 

Topological sort with Kahn's algorithm

graphs topological-sort bfs
Intermediate 6 steps