2017年5月4日

chrome 调试控制台 笔记

摘要: console输出 蓝色小圈 chrome console输出中有时会出现蓝色背景圆圈,然后里面有个数字,代表同样内容输出了多少次:例如: 会出现上述情况。 详细内容参考Google的文档Google Developers ps. 这里要说明一下javascript的setTimeout函数,如果运 阅读全文

posted @ 2017-05-04 15:17 yuanww 阅读(507) 评论(0) 推荐(0) 编辑

2016年5月8日

Leetcode ZigZag Conversion

摘要: Leetcode ZigZag Conversion 做这道题遇到几个点,记录如下 附上说明 Append character to string Appends a single character to the string content, increasing its size by one 阅读全文

posted @ 2016-05-08 20:46 yuanww 阅读(147) 评论(0) 推荐(0) 编辑

2016年4月27日

Leetcode Permutations

摘要: 一. 广度优先搜索BFS 这种方法有些像广度优先搜索BFS,扩展所有可能 类似的做法还有手机键盘字母组合问题 Letter Combinations of a Phone Number https://leetcode.com/discuss/11261/my-iterative-sollution 阅读全文

posted @ 2016-04-27 17:16 yuanww 阅读(461) 评论(0) 推荐(0) 编辑

2016年4月12日

C++ 常用容器or数据结构

摘要: queue 队列 参考 1.入队:如q.push(x):将x元素接到队列的末端; 2.出队:如q.pop() 弹出队列的第一个元素,并不会返回元素的值;T 3,访问队首元素:如q.front() 4,访问队尾元素,如q.back(); deque 双端队列 参考 at() 返回指定的元素 back( 阅读全文

posted @ 2016-04-12 17:26 yuanww 阅读(444) 评论(0) 推荐(0) 编辑

2016年4月11日

链表中间节点位置

摘要: 查找链表中间节点位置有多种方式,首先会想到先遍历一遍获知节点个数,然后取一半作计数器控制访问步数。 另一种常会用到的是设置两个指针:fast_p, slow_p,步长分别为2和1,这样根据物理中 路程公式 s = v * t; fast_p走过的路程是slow_p的两倍,fast_p走到链表尾部时, 阅读全文

posted @ 2016-04-11 21:08 yuanww 阅读(512) 评论(0) 推荐(0) 编辑

2016年4月7日

进制问题

摘要: leetCode上有这么一道题 Excel Sheet Column Title 分析之后可知是一道进制转换的问题,分析的时候偶然间想到digital root的问题,digital root有统一的表达式,是一个9进制问题的转换,如下: dr(n) = 1 + (n - 1) % 9 而此题呢,也 阅读全文

posted @ 2016-04-07 22:01 yuanww 阅读(292) 评论(0) 推荐(0) 编辑

2016年4月6日

Java中ArrayList和LinkedList区别

摘要: 转自http://pengcqu.iteye.com/blog/502676 一般大家都知道ArrayList和LinkedList的大致区别: 1.ArrayList是实现了基于动态数组的数据结构,LinkedList基于链表的数据结构。 2.对于随机访问get和set,ArrayList觉得优于 阅读全文

posted @ 2016-04-06 15:14 yuanww 阅读(405) 评论(0) 推荐(0) 编辑

Preorder, Inorder, and Postorder非递归总结

摘要: Preorder, Inorder, and Postorder Iteratively Summarization[1] 1.Pre Order Traverse 2.In Order Traverse 3.Post Order Traverse 阅读全文

posted @ 2016-04-06 15:12 yuanww 阅读(590) 评论(0) 推荐(0) 编辑

2016年4月5日

Java 集合嵌套List of List

摘要: 在LeetCode上遇到这样返回值 List<List<Integer>> 即List的内容是List的类型,直接使用List<List<Integer>> list = new List<List<Integer>>()是错的,因为List是接口,不能实例化(Cannot instantiate 阅读全文

posted @ 2016-04-05 14:33 yuanww 阅读(23370) 评论(0) 推荐(2) 编辑

2016年4月3日

Java 按值传递

摘要: http://guhanjie.iteye.com/blog/1683637 http://www.zhihu.com/question/31203609 String类 1.String 类按照 Java 语言的规定,String 类是 immutable 的 Unicode 字符序列,其作用是实 阅读全文

posted @ 2016-04-03 19:27 yuanww 阅读(285) 评论(0) 推荐(0) 编辑

导航