数据结构
小协
码农界的一只小小鸟~
展开
-
有关二叉树的一些问题集合(一)
二叉树的数据结构class TreeNode{ int val; //左孩子 TreeNode left; //右孩子 TreeNode right;}1.求二叉树的最大深度int maxDeath(TreeNode node){ if(node==null){ return 0; } int left = maxDe原创 2017-09-25 23:09:26 · 197 阅读 · 0 评论 -
php全组合代码实现
php全组合代码实现$a = ['a', 'b', 'c'];$b = get_combinations($a);echo json_encode($b);function get_combinations($str, &$comb = []){ if (count($str) > 1) { $str_first = array_shift($st...原创 2018-11-30 17:15:18 · 621 阅读 · 1 评论