上一页 1 ··· 204 205 206 207 208 209 210 211 212 ··· 233 下一页
摘要: https://leetcode.com/problems/serialize-and-deserialize-bst/ 1. 用到Java Queue接口, // LinkedList实现了Queue接口, ArrayList没有实现 2. 用的Java String.split 函数得到 Str 阅读全文
posted @ 2016-11-01 15:36 blcblc 阅读(351) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/ 之前有一道题目:http://www.cnblogs.com/charlesblc/p/5998825.html "find-all-duplicates- 阅读全文
posted @ 2016-11-01 13:55 blcblc 阅读(885) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/find-right-interval/ Java里面TreeMap或者TreeSet有类似C++的lower_bound或者upper_bound的函数:floor(取出不大于xx的)和ceiling(取出不小于xx的) 阅读全文
posted @ 2016-10-31 23:01 blcblc 阅读(520) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/non-overlapping-intervals/ 其中还用到了Java的Comparator接口和其中的compare方法。 阅读全文
posted @ 2016-10-31 22:27 blcblc 阅读(490) 评论(0) 推荐(0)
摘要: 你的文件分隔符恐怕不止一个空格(一定的who生成的): 用awk: awk '{print $2}' file 一定要用cut的话: cat file|tr -s ' '|cut -d' ' -f2 通过使用 tr,您可以非常容易地实现 sed 的许多最基本功能。您可以将 tr 看作为 sed 的( 阅读全文
posted @ 2016-10-31 22:20 blcblc 阅读(24233) 评论(0) 推荐(1)
摘要: https://leetcode.com/problems/arranging-coins/ 阅读全文
posted @ 2016-10-31 12:20 blcblc 阅读(302) 评论(0) 推荐(0)
摘要: 看了这篇文章 http://www.ruanyifeng.com/blog/2010/04/using_this_keyword_in_javascript.html 分情况讨论。 情况一:纯粹的函数调用 这是函数的最通常用法,属于全局性调用,因此this就代表全局对象Global。 情况二:作为对 阅读全文
posted @ 2016-10-30 23:51 blcblc 阅读(152) 评论(0) 推荐(0)
摘要: 阮一峰这篇文章写的很好 http://www.ruanyifeng.com/blog/2011/06/designing_ideas_of_inheritance_mechanism_in_javascript.html 笔记如下: 一、从古代说起 二、Brendan Eich的选择 三、new运算 阅读全文
posted @ 2016-10-30 23:40 blcblc 阅读(253) 评论(0) 推荐(0)
摘要: 学习参考这篇文章: http://www.shareditor.com/blogshow/?blogId=96 机器学习、数据挖掘等各种大数据处理都离不开各种开源分布式系统, hadoop用于分布式存储和map-reduce计算, spark用于分布式机器学习, hive是分布式数据库, hbase 阅读全文
posted @ 2016-10-30 21:47 blcblc 阅读(7485) 评论(1) 推荐(0)
摘要: 中序遍历 步骤如下: 关于时间复杂度,其实也是O(n)。分析如下: 前序遍历(相比中序遍历,只是输出当前节点的顺序稍有不同) 后序遍历(需要加入两个小的技巧,一是dump节点,二是倒序输出路径) 复杂度分析: 空间复杂度同样是O(1);时间复杂度也是O(n),倒序输出过程只不过是加大了常数系数。 上 阅读全文
posted @ 2016-10-30 17:14 blcblc 阅读(982) 评论(0) 推荐(0)
上一页 1 ··· 204 205 206 207 208 209 210 211 212 ··· 233 下一页