摘要:
记忆化递归解法: //结果计数 int an = 0; /** * @Author Niuxy * @Date 2020/6/30 10:38 下午 * @Description 外部循环,以每个元素开头的子串 * 内部循环,以每个元素结尾的子串 * 就可以遍历到所有长度大于 1 的可能的子串 */ 阅读全文
posted @ 2020-06-30 23:10
牛有肉
阅读(176)
评论(0)
推荐(0)
摘要:
回溯算法: public final boolean exist(char[][] board, String word) { if (board == null || word == null || word.length() > board.length * board[0].length) { 阅读全文
posted @ 2020-06-30 22:04
牛有肉
阅读(181)
评论(0)
推荐(0)
摘要:
暴力解法: public final boolean canPartition1(int[] nums) { //边界 if (nums == null || nums.length < 2) { return false; } //剪枝 int sum = 0; int max = 0; for 阅读全文
posted @ 2020-06-30 20:52
牛有肉
阅读(233)
评论(0)
推荐(0)

浙公网安备 33010602011771号