Peterson's algorithm (AKA Peterson's solution) is a concurrent
programming algorithm for mutual
exclusion that allows two processes to share a single-use resource without conflict, using only shar...
分类:
编程语言 时间:
2014-06-25 19:38:19
阅读次数:
748
class Solution {public: int reverse(int x) { bool neg = x < 0; long long num = x; if (neg) num = -num; long long out = ...
分类:
其他好文 时间:
2014-06-25 18:24:01
阅读次数:
280
class Solution {public: int removeElement(int A[], int n, int elem) { if (A == NULL || n < 1) return 0; int rpos = 0, wpos = 0; ...
分类:
其他好文 时间:
2014-06-25 17:47:57
阅读次数:
234
Write a function to find the longest common prefix string amongst an array of strings.public class Solution { public String longestCommonPrefix(Str...
分类:
其他好文 时间:
2014-06-25 17:03:03
阅读次数:
331
微软近期Open的职位:Job Summary:Be part of Microsoft’s strategy to deliver a great input experience across the Microsoft platforms! We are looking for an expe...
分类:
其他好文 时间:
2014-06-25 11:13:03
阅读次数:
257
class Solution {public: int threeSumClosest(vector &num, int target) { int len = num.size(); if (len target) { q-...
分类:
其他好文 时间:
2014-06-24 21:22:03
阅读次数:
138
题目
Implement pow(x, n).
解答
直接用递归法:
//递归法("折半"递归,不要用常规的一个个乘,效率很低)
public class Solution {
public double pow(double x, int n) {
if(n==0)
return 1;
if(n==1)
...
分类:
其他好文 时间:
2014-06-24 21:14:37
阅读次数:
199
【问题】
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
【代码】
class Solution:
# @param s, a string
# @retu...
分类:
其他好文 时间:
2014-06-24 21:00:30
阅读次数:
168
Given a collection of integers that might contain duplicates, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain duplica...
分类:
其他好文 时间:
2014-06-24 20:58:32
阅读次数:
230
代码下载:基于隐马尔可夫模型的有监督词性标注
词性标注(Part-of-Speech tagging 或 POS tagging)是指对于句子中的每个词都指派一个合适的词性,也就是要确定每个词是名词、动词、形容词或其他词性的过程,又称词类标注或者简称标注。词性标注是自然语言处理中的一项基础任务,在语音识别、信息检索及自然语言处理的许多领域都发挥着重要的作用。
词性标注本质上是...
分类:
其他好文 时间:
2014-06-24 20:05:51
阅读次数:
233