- 博客(14)
- 收藏
- 关注
原创 [LeetCode] LRU Cache
题目: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 value (will always be positive) of th
2014-08-02 21:58:35
278
原创 [LeetCode] Sqrt(x)
题目:Implement int sqrt(int x).Compute and return the square root of x.
2014-07-28 18:45:16
323
原创 [LeetCode] Swap Nodes in Pairs
题目:Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant
2014-07-26 00:33:55
291
原创 [LeetCode] Climbing Stairs
题目:You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?题解:可以由递推关系得出
2014-07-25 23:36:54
253
原创 [LeetCode] Populating Next Right Pointers in Each Node
题目:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next right
2014-07-25 22:20:27
214
原创 [LeetCode] Longest Substring Without Repeating Characters
题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is
2014-07-24 00:36:49
349
原创 [LeetCode] Multiply Strings
题目:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.题解:
2014-07-24 00:27:55
317
原创 [LeetCode] Palindrome Number
class Solution {public: bool isPalindrome(int x) { if( x < 0 ) return false; int count = 1; int p = x; while( p/10 != 0){ count++; p /= 10; } for(int i = 0; i < count/
2014-05-26 14:30:44
280
原创 Latent Dirichlet Allocation
最近一直在看LDA,等看的明白了,整理一篇文档出来。虽然现在有很多关于LDA的深入浅出的文章,但是觉得还是自己整理的比较易于自己理解
2014-03-19 08:55:41
443
原创 [LeetCode] Single Number
Title:Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without u
2014-03-13 21:23:23
287
转载 正整数序列 (Help is needed for Dexter, UVa 11384)
给定正整数n,你的任务是用最少的操作次数把序列1, 2, 3 ... n 中的所有数都变为0。 每次操作可以从序列中选择一个或多个整数,同时减去一个相同的正整数。比如,1,2,3可以把2和3同时减小2,得到1,0,1.【输入格式】输入包含多组数据。每组仅一行,为正整数n(n 【输出格式】对于每组数据,输出最少操作次数。【题解】每次减去(n/2+1)。这样剩下的一部分
2014-01-23 20:19:26
578
翻译 Network Component Analysis(NCA)
在生物信息中,常常会有大量的多维数据出现,自然而然,我们想寻找一个降维的方法进行处理。在Liao[03]年的PANS论文上就提出了一个新的降维方法-----Network Component Analysis(NCA)。在这篇论文中,他也提出了其他两种用于生物网络的统计学方法PCA、ICA的缺点:1、在调控信号上暗含的统计假设缺少生物学基础(First, the implicit statisti
2013-12-30 09:48:00
865
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人