07 2014 档案

摘要:转载自:http://c4fun.cn/blog/2014/05/06/python-threading/python中关于多线程的操作可以使用thread和threading模块来实现,其中thread模块在Py3中已经改名为_thread,不再推荐使用。而threading模块是在thread之... 阅读全文
posted @ 2014-07-17 10:16 肥磊 阅读(362) 评论(0) 推荐(0)
摘要:二叉树的遍历是面试中经常考察的,其实前中后三种顺序的遍历都大同小异,自己模拟两个栈用笔画画我相信是不难写出代码的。现罗列如下,均是自己所写已通过leetcode。 1 class Solution { 2 public: 3 vector preorderTraversal(TreeNode... 阅读全文
posted @ 2014-07-17 09:29 肥磊 阅读(279) 评论(0) 推荐(0)
摘要:Notice: How to compile C++ with C++ 11 support in Mac Terminalstackoverflow上面的问题其实mac里面的不是g++而是clang 我们输入:g++ --version查看其实是clangso linux下的g++ -std=c+... 阅读全文
posted @ 2014-07-14 23:44 肥磊 阅读(2749) 评论(0) 推荐(0)
摘要:Given an input string, reverse the string word by word.For example,Given s = " the sky is blue ",return "blue is sky the".click to show clarification.... 阅读全文
posted @ 2014-07-10 23:42 肥磊 阅读(244) 评论(0) 推荐(0)
摘要:Notice:Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.For example:Input: ["tea","an... 阅读全文
posted @ 2014-07-09 15:45 肥磊 阅读(404) 评论(0) 推荐(0)
摘要:上周算法班的BEN老师花了1个小时讲自动机和KMP的关系,结果failed...明天又要上课了,花了半天时间看了下KMP,暂且停留在利用next求模式中的跳跃长度,自动机那个还不能理解。。。具体的可以百度阮一峰的KMP算法。看着什么前缀后缀,突然想到上下文无关文法乔姆斯基范式了。。。。又想到了NFA... 阅读全文
posted @ 2014-07-04 23:14 肥磊 阅读(3463) 评论(0) 推荐(0)
摘要:折腾了大半天,终于把mbp上python自然语言开发环境搭建好了。第一步,安装JDK1.7 for mac MacOS10.9是自带python2.7.5的,够用,具体的可以打开终端输入python显示版本号码。在10.9中MacOS没有自带的JDK1.7所以我们得先安装JDK1.7 for ... 阅读全文
posted @ 2014-07-03 16:53 肥磊 阅读(1927) 评论(1) 推荐(0)
摘要:记得去年9月28日赶到交大去听july的算法面试讲座,他给我们出的第一个题目就是用代码实现atoi,限时10mins。由于当时很久没接触编程,当堂没写出来。记得当时讲解的时候就是要我们特别注意边界条件。写程序就像砌围墙,得先把边界条件弄好。转眼一年过去了,再过几个月就要出去hunting job... 阅读全文
posted @ 2014-07-02 16:33 肥磊 阅读(932) 评论(0) 推荐(0)
摘要:题目:A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any poi... 阅读全文
posted @ 2014-07-02 12:30 肥磊 阅读(544) 评论(0) 推荐(0)
摘要:暑假开始研究NLP,先从宗成庆老师的《统计自然语言处理》开始学起。一、语言:语言是由语音、词汇和语法构成的,语音和文字是构成语言的两个基本属性,语音是语言的物质外壳,文字则是记录语言的书写符号系统。二、语音学:1)发音语音学(articulatory phonetics) 2)声学语音... 阅读全文
posted @ 2014-07-02 11:11 肥磊 阅读(489) 评论(0) 推荐(0)