Tag Archives: DFS

  1. Combination Sum IV

    Leave a comment

    September 16, 2017 by oneOokay

    其他的Combination Sum Combination Sum IV Given an integer array with all positive numbers and no duplicates, find the number of …
    Continue reading

  2. 01 Matrix

    Leave a comment

    June 20, 2017 by oneOokay

    Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell. The distance …
    Continue reading

  3. Generate Parentheses

    Leave a comment

    May 14, 2017 by oneOokay

    Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = …
    Continue reading

  4. Longest Increasing Path in a Matrix

    Leave a comment

    December 19, 2016 by oneOokay

    Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to …
    Continue reading

  5. Course Schedule I II

    Leave a comment

    December 19, 2016 by oneOokay

    There are a total of n courses you have to take, labeled from 0 to n – 1. Some courses …
    Continue reading

  6. Topological Sorting Related

    Leave a comment

    December 18, 2016 by oneOokay

    拓扑排序以及相关题目: 拓扑排序 For each directed edge A -> B in graph, A must before B in the order list. The …
    Continue reading

  7. Sudoku Solver

    Leave a comment

    December 17, 2016 by oneOokay

    典型的DFS。boolean solve(char[][] board):DFS recursive的函数返回可以是void,TreeNode和boolean 了。(还有之后的List和ArrayList) public void solveSudoku(char[][] board) { solve(board); } private boolean solve(char[][] board){ //recursive method for (int …
    Continue reading