Basics

class UndirectedGraphNode {
    int label;
    List<UndirectedGraphNode> neighbors;

    UndirectedGraphNode(int label) {
        this.label = label;
        this.neighbors = new ArrayList<>()
    }
}

Problems

clone graph: http://www.lintcode.com/en/problem/clone-graph/

topological sort: http://www.lintcode.com/en/problem/topological-sorting/

course schedule: https://leetcode.com/problems/course-schedule/description/

graph valid tree: https://leetcode.com/problems/graph-valid-tree/description/

is reachable

topological sort

hasCycle

results matching ""

    No results matching ""