2015年11月10日

LeetCode237-Delete Node in a Linked List

摘要: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 ->... 阅读全文

posted @ 2015-11-10 10:51 露台上对望 阅读(463) 评论(0) 推荐(0) 编辑

2015年11月9日

LeetCode104-Maximum Depth of Binary Tree

摘要: Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le... 阅读全文

posted @ 2015-11-09 15:19 露台上对望 阅读(122) 评论(0) 推荐(0) 编辑

2015年10月9日

LeetCode 204-Count Primes

摘要: Description:Count the number of prime numbers less than a non-negative number,n.描述:计算小于n的质数的个数 这里用到的方法是埃拉托色尼筛选法(Sieve of Eratosthenes),思路大致为:对于1~n-1这... 阅读全文

posted @ 2015-10-09 15:29 露台上对望 阅读(180) 评论(0) 推荐(0) 编辑

2015年10月8日

LeetCode 263-Ugly Number

摘要: Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For examp... 阅读全文

posted @ 2015-10-08 21:01 露台上对望 阅读(189) 评论(0) 推荐(0) 编辑

2015年10月6日

LeetCode 258-Add Digits

摘要: Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is like:3 + ... 阅读全文

posted @ 2015-10-06 16:44 露台上对望 阅读(201) 评论(0) 推荐(0) 编辑

2015年8月11日

使用MATLAB贝叶斯工具箱(BNT),进行吉布斯采样(Gibbs Sampling)之前需要做的编译工作

摘要: 使用BNT(Bayesian Networks Toolbox)进行推断时,内置了吉布斯采样算法(即gibbs_sampling_inf_engine),但是如果调用这个引擎做推断会报错。报错内容大概是compute_posterior这个函数没有找到,然后进入..\@gibbs_samplin... 阅读全文

posted @ 2015-08-11 21:21 露台上对望 阅读(1239) 评论(0) 推荐(0) 编辑

导航