解题:利用队列先进先出来实现层次遍历 /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) ...
分类:
其他好文 时间:
2020-07-18 19:52:44
阅读次数:
68
function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i<vars.length;i++) { ...
分类:
编程语言 时间:
2020-07-18 16:10:40
阅读次数:
93
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ ...
分类:
其他好文 时间:
2020-07-18 15:54:16
阅读次数:
51
~/.vimrc内容如下: set nocompatible filetype off set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'tpope/vim-fugi ...
分类:
系统相关 时间:
2020-07-18 13:52:57
阅读次数:
109
kyu8--fake binary 将小于5的数字用0掩码,大于等于5的用1掩码,用string 下面的答案是高赞的答案。return s.translate(string.maketrans('0123456789', '0000011111')) ...
分类:
其他好文 时间:
2020-07-18 13:46:35
阅读次数:
64
链接:https://leetcode-cn.com/problems/unique-binary-search-trees-ii/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNo ...
分类:
其他好文 时间:
2020-07-18 13:39:30
阅读次数:
56
Java顺序查找、二分查找 查找算法中顺序查找算是最简单的了,无论是有序的还是无序的都可以,只需要一个个对比即可,但其实效率很低。 顺序查找 动图演示 详细代码 // 顺序查找 public static boolean search(int[] arrray, int key) { for (in ...
分类:
编程语言 时间:
2020-07-18 13:34:27
阅读次数:
57
链接:https://leetcode-cn.com/problems/binary-tree-inorder-traversal/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNo ...
分类:
其他好文 时间:
2020-07-18 11:34:31
阅读次数:
66
Variable Ordering for Efficient SAT Search by Analyzing Constraint-Variable Dependencies Vijay Durairaj and Priyank KallaDepartment of Electrical and ...
分类:
其他好文 时间:
2020-07-18 11:33:24
阅读次数:
75
链接:https://leetcode-cn.com/problems/unique-binary-search-trees/ 代码 class Solution { public: int numTrees(int n) { vector<int> f(n + 1); f[0] = 1; for ...
分类:
其他好文 时间:
2020-07-18 11:25:21
阅读次数:
56