摘要: 熵: 表示随机变量不确定性的度量。 只依赖于随机变量X的分布,与其取值无关 0<=H(X)<=log(n),当随机变量X符合均匀分布时,熵最大 最大熵: 最大熵可理解为满足现有约束条件的情况下,其余不确定的信息默认为等可能的 阅读全文
posted @ 2016-08-14 19:10 影翕 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 1.行列式 二阶行列式= a * d - b * c 三阶行列式= a11*a22*a33+a12*a23*a31+a13*a21*a32 -a31*a22*a13-a32*a23*a11-a33*a21*a12 //三条线减三条线 1,2,3 全排列:1,2,3 1,3,2 2,1,3 2,3,1 阅读全文
posted @ 2016-08-10 22:21 影翕 阅读(250) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: /** * @param obstacleGrid: A list of lists of integers * @return: An integer */ int uniquePathsWithObstacle... 阅读全文
posted @ 2015-09-09 19:13 影翕 阅读(206) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: /** * @param n, m: positive integer (1 <= n ,m <= 100) * @return an integer */ int uniquePaths(int m, int n)... 阅读全文
posted @ 2015-09-08 10:15 影翕 阅读(112) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: /** * @param s: The first string * @param b: The second string * @return true or false */ bool anagram(s... 阅读全文
posted @ 2015-09-05 23:22 影翕 阅读(154) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: /** * @param x: An integer * @return: The sqrt of x */ int getResult(long start, long end, long target){ ... 阅读全文
posted @ 2015-09-05 10:20 影翕 阅读(175) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: /* * @param n: An integer * @return: True or false */ bool checkPowerOf2(int n) { // write your code ... 阅读全文
posted @ 2015-09-02 15:39 影翕 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public: 3 /** 4 * param n: As description. 5 * return: A list of strings. 6 */ 7 vector fizzBuzz(int n) {... 阅读全文
posted @ 2015-09-02 15:31 影翕 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 题目意思:判断一个字符串(){}[]是否符合思路:用栈ps:实习一个多月了,代码也刷不动了,状态真不是一般的差class Solution {public: bool isValid(string s) { if(s==""||s.size()%2==1) ... 阅读全文
posted @ 2015-08-17 16:30 影翕 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1.assert 断言语句,可判断一句话真假,若为假会抛出AssertionError。 eg. assert 1==1 assert 1==2则AssertionError 2.单引号双引号 f1=open('xxx')和f1=open("xxx")效果相同 s = "aa" 与 ... 阅读全文
posted @ 2015-08-11 13:10 影翕 阅读(117) 评论(0) 推荐(0) 编辑