摘要: 1.字符流中第一个不重复的字符 题目:请实现一个函数用来找出字符流中第一个只出现一次的字符。 举例说明 例如,当从字符流中只读出前两个字符“go”时,第一个只出现一次的字符是‘g’。当从该字符流中读出前六个字符“google”时,第一个只出现 1 次的字符是”l”。 解题思路 字符只能一个接着一个从 阅读全文
posted @ 2016-09-28 12:13 毛线刷题笔记 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 1. Unique Characters of a String 字符串中不同的字符 Implement an algorithm to determine if a string has all unique characters. What if you cannot use additiona 阅读全文
posted @ 2016-09-28 11:42 毛线刷题笔记 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 1.permutations Given a list of numbers, return all possible permutations. For nums = [1,2,3], the permutations are: [ [1,2,3], [1,3,2], [2,1,3], [2,3, 阅读全文
posted @ 2016-09-28 09:33 毛线刷题笔记 阅读(1772) 评论(0) 推荐(0) 编辑
摘要: Angular Js level 1: Directives, used to bind the behavior Modules: container for all the angular application creat a module treat this html as part of 阅读全文
posted @ 2016-09-22 13:03 毛线刷题笔记 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 1. Counting Bits Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary rep 阅读全文
posted @ 2016-09-16 07:02 毛线刷题笔记 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Stack 1. MinStack 2 Longest Valid Parentheses 求最长的合理的() 利用stack做(的积累和匹配 利用gobal变量和local变量做更新 注意 ()(()的时候,也就是说 当)与stack里的(做了匹配之后 需要判断stack是否为空, 不为空的话,往 阅读全文
posted @ 2016-09-14 15:09 毛线刷题笔记 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 了解你所面试的公司:产品,成立时间,融资,竞争对手; 分析算法的时间和空间复杂度(Big-O); java/c++ 熟练掌握一门,python面试算法题其实也ok。 对语言的细节特性有足够的理解,理解语言之间的差异,比如解释执行vs编译执行,java jvm, garbage collection等 阅读全文
posted @ 2016-09-12 01:39 毛线刷题笔记 阅读(153) 评论(0) 推荐(0) 编辑
摘要: two sum类题目思路: 通过对撞型指针优化算法,根本上其实就是不用扫描多余状态。 1 if (A[i] + A[j] < sum) { 2 j--; 3 do someting; 4 } else if { 5 i++; 6 do someting; 7 } else { 8 do someth 阅读全文
posted @ 2016-08-26 09:46 毛线刷题笔记 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 这道题的trick在于如果从小到大排列的话,涉及到数组从左向右移动的问题。 所以这道题从大到小进行排序。 另外,这道题中该学习到的coding style,当需要处理2个数组/list时候 用 while (a != null && b != null) {} while (a != null) { 阅读全文
posted @ 2016-08-17 11:22 毛线刷题笔记 阅读(94) 评论(0) 推荐(0) 编辑
摘要: quick sort version 1: quick sort 定义: https://en.wikipedia.org/wiki/Quicksort quick sort 核心部分为partition(http://www.cnblogs.com/jiangchen/p/5398166.html 阅读全文
posted @ 2016-05-28 04:48 毛线刷题笔记 阅读(170) 评论(0) 推荐(0) 编辑