c++ boost库

摘要: boost是C++标准委员会库工作组发起的开源库,内容十分强大。支持正则表达式,多线程编程,数据结构图(STL扩展),智能指针,python语法等功能。linux下安装boosthttp://blog.csdn.net/i_noname/article/details/632344Linux上安装使... 阅读全文
posted @ 2014-12-21 12:02 Jack_Cheng 阅读(159) 评论(0) 推荐(0) 编辑

R条件筛选

摘要: R按条件过滤非常简便,假设x为一个vector或data frame,比如x5&is.na(x)] //y返还大于5且非na的值2) index或interval筛选y<-x[1] //y返还x第一个值y<-x[2:5] //y返还x第2到5个值y<-x[-(2:5)] //y返还除第2到第5个以外... 阅读全文
posted @ 2014-12-04 11:54 Jack_Cheng 阅读(895) 评论(0) 推荐(0) 编辑

Leetcode word ladder 经典搜索题目

摘要: Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter ca... 阅读全文
posted @ 2014-12-03 17:20 Jack_Cheng 阅读(104) 评论(0) 推荐(0) 编辑

数据结构复习--binary tree pre-order / post-order / in-order traversal

摘要: 简单递归实现:/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ ... 阅读全文
posted @ 2014-11-25 16:56 Jack_Cheng 阅读(628) 评论(0) 推荐(0) 编辑

数据结构复习--binary tree level-order traversal

摘要: 一个笨办法用两个Queue实现:/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; ... 阅读全文
posted @ 2014-11-25 16:27 Jack_Cheng 阅读(330) 评论(0) 推荐(0) 编辑

hadoop streaming,排序,分区

摘要: 一个简单示例:hadoop jar ${hdstreaming} \-D mapreduce.job.queuename=mapreduce.normal \ #Hadoop 2.0一定要指定队列名-D mapreduce.job.name='UserFeature::Predict' \-D st... 阅读全文
posted @ 2014-11-25 10:34 Jack_Cheng 阅读(589) 评论(0) 推荐(0) 编辑

Pasca triangle

摘要: GivennumRows, generate the firstnumRowsof Pascal's triangle.Java:public class Solution { public List> generate(int numRows) { List> result =... 阅读全文
posted @ 2014-11-21 16:59 Jack_Cheng 阅读(130) 评论(0) 推荐(0) 编辑

Linked list cycle

摘要: Given a linked list, determine if it has a cycle in it. (Without using eatra space)//Solution: define two pointers, one moves one step each time while... 阅读全文
posted @ 2014-11-20 12:57 Jack_Cheng 阅读(126) 评论(0) 推荐(0) 编辑

Path Sum

摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Ja... 阅读全文
posted @ 2014-11-20 12:56 Jack_Cheng 阅读(119) 评论(0) 推荐(0) 编辑

Minimum depth of the tree

摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le... 阅读全文
posted @ 2014-11-20 12:55 Jack_Cheng 阅读(91) 评论(0) 推荐(0) 编辑