- 博客(4)
- 收藏
- 关注
原创 马尔科夫链(markov chain)
A Markov chain is “a stochastic model describing a sequence of possible events in which the probability of each event depends only on the state attained in the previous event.”马尔科夫链虽然听上去很高深莫测,但其...
2018-05-13 23:41:39 4720
转载 从标准输入输出看流和缓冲区
学习标准输入输出,我们都会遇到一个概念,流和缓冲区,但到底什么是流,什么是缓冲区呢? 书《C Primer Plus》上说,C程序处理一个流而不是直接处理文件。后面的解释十分抽象:『流(stream)是一个理想化的数据流,实际输入或输出映射到这个数据流』。这个流具体是一个怎么样的东西呢?流这个定义非常的形象。我们可以这样理解: 你声明一个FILE *fp ,并把fopen(某个文件...
2018-05-07 16:40:27 1153 1
原创 Leetcode 677. Map Sum Pairs
题目链接 Implement a MapSum class with insert, and sum methods. For the method insert, you’ll be given a pair of (string, integer). The string represents the key and the integer represents the valu...
2018-05-07 08:55:20 375
原创 Leetcode 76. Minimum Window Substring
题目链接 Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).自然的想法是从左向右扫,将S[i]加入window。当window满足条件时,尝试从window头踢字符(为了使window最小...
2018-05-06 22:45:39 138
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人