上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页
摘要: https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/submissions/ 把一个list转化为平衡树 Runtime: 104 ms, faster than 88.84% of Python3 onl 阅读全文
posted @ 2019-01-13 00:17 dgi 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-01-11 13:24 dgi 阅读(224) 评论(0) 推荐(0) 编辑
摘要: batch 深度学习的优化算法,说白了就是梯度下降。每次的参数更新有两种方式。 第一种,遍历全部数据集算一次损失函数,然后算函数对各个参数的梯度,更新梯度。这种方法每更新一次参数都要把数据集里的所有样本都看一遍,计算量开销大,计算速度慢,不支持在线学习,这称为Batch gradient desce 阅读全文
posted @ 2019-01-08 09:06 dgi 阅读(3420) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/sort-array-by-parity/ easy/easy 把列表里的偶数放在前面,奇数放在后面 Runtime: 108 ms, faster than 17.99% of Python online submissions for  阅读全文
posted @ 2019-01-06 11:53 dgi 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 有错,先序相同,树不一定同 1.先要有正确的求解思路 2.递归是常用的套路 阅读全文
posted @ 2019-01-04 23:03 dgi 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 自己其实想到了可以不用先转化成list,直接反向递归操作,但是写代码时依然有些混乱 1.对self的使用不是很明了。 类内函数要用self,函数内定义函数不用self 参见博客:https://blog.csdn.net/CLHugh/article/details/75000104 2.递归使用不 阅读全文
posted @ 2019-01-03 22:12 dgi 阅读(86) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/construct-string-from-binary-tree/ 把一个树,先序遍历一遍,左右孩子分别用括号包起来,不影响还原的情况下,删去多余的括号 报错,运行不起来 Runtime: 68 ms, faster than 34.47 阅读全文
posted @ 2019-01-02 21:10 dgi 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 1.中序遍历不会,这不是中序遍历 2.这样没有得到中序遍历 Runtime: 84 ms, faster than 56.86% of Python online submissions for Two Sum IV - Input is a BST. Runtime: 108 ms, faster 阅读全文
posted @ 2018-12-27 22:00 dgi 阅读(110) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/n-ary-tree-level-order-traversal/ 队列操作不熟悉 层序遍历树 1.对队列的操作不熟悉 2. 阅读全文
posted @ 2018-12-25 20:41 dgi 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 真的是第一次完全没有看其他参考答案,第一次写出来,而且没有报错,值得庆祝一下。虽然题目很简单,但是我在使用递归时,还是害怕细节出错,ヾ(◍°∇°◍)ノ゙ 求二叉树的高度 只要递归下去就可以了 1.map函数的使用,可以简化代码、 2.使用队列可以更加快速 阅读全文
posted @ 2018-12-24 16:44 dgi 阅读(123) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页