摘要: There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following req... 阅读全文
posted @ 2014-04-26 17:39 linyx 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 假设数据是这样子的:2 104 208 3016 4032 5064 60128 70256 80512 901024 100gnuplot脚本如下: 1 set terminal postscript eps color enhanced... 阅读全文
posted @ 2014-04-24 14:28 linyx 阅读(3796) 评论(0) 推荐(1) 编辑
摘要: 1. 在tex文件中加入:1 \bibliographystyle{plain} %这是格式2 \bibliography{reffile} % reffile.bib是reference的文件2. .bib文件包含引用的文章,可以直接通过google scholar导入,但是只能单条单条地导入,貌... 阅读全文
posted @ 2014-04-23 15:51 linyx 阅读(459) 评论(1) 推荐(0) 编辑
摘要: 不小心把选项卡(标签页、多tab)整没了。搜了一下:在工具栏点击右键可以发现配置。 阅读全文
posted @ 2014-04-23 11:37 linyx 阅读(655) 评论(0) 推荐(0) 编辑
摘要: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the ... 阅读全文
posted @ 2014-04-15 15:55 linyx 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 奋是基础,一切的前提奋之上是忍耐大部分时候大部分人的“习惯”都是跟“效率”作对的奋让你有机会去跟这些习惯做斗争在 ACM 竞赛的级别,写代码不是在解题,而是实现早已在脑子里准备好的一个逻辑流程。这个追求跟大部分没有训练过的人的习惯相反,要扭转这种习惯,第一步可以做尝试有:1. 把准备和敲键盘分割为两... 阅读全文
posted @ 2014-04-15 01:02 linyx 阅读(229) 评论(0) 推荐(0) 编辑
摘要: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representatio... 阅读全文
posted @ 2014-04-14 16:36 linyx 阅读(165) 评论(0) 推荐(0) 编辑
摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ... 阅读全文
posted @ 2014-04-14 14:46 linyx 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.top-down还是o(nlgn)。自己没有细想,不过查了一下,发现还是有o(n)... 阅读全文
posted @ 2014-04-14 12:00 linyx 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 求子串当然最经典的就是KMP算法了。brute force算法在leetcode上貌似也有一些技巧。brute force: 1 char* StrStr(const char *str, const char *target) { 2 if (!*target) return str; 3 ... 阅读全文
posted @ 2014-04-13 23:36 linyx 阅读(375) 评论(0) 推荐(0) 编辑