真的是第一次完全没有看其他参考答案,第一次写出来,而且没有报错,值得庆祝一下。虽然题目很简单,但是我在使用递归时,还是害怕细节出错,ヾ(?°?°?)?? 求二叉树的高度 只要递归下去就可以了 1.map函数的使用,可以简化代码、 2.使用队列可以更加快速 ...
分类:
其他好文 时间:
2018-12-24 17:20:12
阅读次数:
150
必须用dfs的才用dfs求解,显而易见可以动态规划的都用动态规划求解。 https://leetcode.com/tag/depth-first-search/ ...
分类:
其他好文 时间:
2018-12-20 01:03:34
阅读次数:
188
Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either an integer, or a list -- w ...
分类:
其他好文 时间:
2018-12-19 15:50:19
阅读次数:
143
第一次写出了具有迭代和递归的函数,还是有点收获的,虽然题目比较简答 当要对某些对象重复使用时,考虑循环,也就是迭代 当函数可以简化一个重复的操作时,考虑递归,而且就当下一次使用这和函数的结果已经有啦,就不会考虑的太复杂 自己写的答案: 反思学习: 1.对list不知道是None还是[ ]的时候,使用 ...
分类:
其他好文 时间:
2018-12-18 22:40:12
阅读次数:
251
tensorflow 的one_hot 比较灵活,可以使用depth指定生成one_hot向量的维度,indices长度说明生成one_hot向量的个数,而其中的数字指定在向量的哪个位置中使用on_value(默认1)激活; axis 指定生成的矩阵的排列方式。 ...
分类:
其他好文 时间:
2018-12-18 22:37:59
阅读次数:
215
转自:http://www.cnblogs.com/skywang12345/ 深度优先搜索的图文介绍 1. 深度优先搜索介绍 图的深度优先搜索(Depth First Search),和树的先序遍历比较类似。 它的思想:假设初始状态是图中所有顶点均未被访问,则从某个顶点v出发,首先访问该顶点,然后 ...
分类:
其他好文 时间:
2018-12-16 18:05:57
阅读次数:
108
[TOC] 参考博客: https://cuijiahua.com/blog/2018/02/dl_6.html 1. Depth Separable Convolution A standard convolution both filters and combines inputs into a ...
分类:
Web程序 时间:
2018-12-16 16:40:23
阅读次数:
185
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l ...
分类:
其他好文 时间:
2018-12-09 20:01:10
阅读次数:
168
1.首先我创建了简单的拓扑,深度为2,扇面为2. 1 1 mn --controller remote --topo tree,fanout=3,depth=2 1 1 mn --controller remote --topo tree,fanout=3,depth=2 1 1 mn --cont ...
分类:
其他好文 时间:
2018-12-02 20:05:49
阅读次数:
320
19. Remove Nth Node From End of List minimum-depth-of-binary-tree Given a binary tree, find its minimum depth.The minimum depth is the number of nodes ...
分类:
其他好文 时间:
2018-12-02 14:21:25
阅读次数:
137