回溯
fxy流年无悔
不要留下太多遗憾
展开
-
回溯-力扣-java
class Solution { public boolean exist(char[][] board, String word) { char []words=word.toCharArray(); for(int i=0;i<board.length;i++){ for(int j=0;j<board[0].length;j++){ if(dfs(board,words,i,j,0)...原创 2020-05-24 22:46:16 · 181 阅读 · 0 评论 -
树-回溯-面试题34. 二叉树中和为某一值的路径
解题思路: /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class So...原创 2020-04-19 10:57:22 · 114 阅读 · 0 评论