摘要: Subsets IIGiven a collection of integers that might contain duplicates,nums, return all possible subsets.Note:Elements in a subset must be in non-desc... 阅读全文
posted @ 2015-09-28 11:47 wxquare 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 该环境在Vmware Workstation 12 上安装配置一共三台机器master,slave1,slave2.操作系统:Cenos 7.0hadoop 版本:hadoop-0.20.2,版本比较老,资料比较多,便于入门学习。官网找不到可以在http://pan.baidu.com/s/1eQF... 阅读全文
posted @ 2015-09-27 16:48 wxquare 阅读(564) 评论(0) 推荐(0) 编辑
摘要: 问题描述: Given a set of distinct integers,nums, return all possible subsets. Note:Elements in a subset must be in non-descending order.The solution set m... 阅读全文
posted @ 2015-09-26 17:43 wxquare 阅读(208) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include //the next permutationtemplatebool STL_next_permutation(BidirIt first, BidirIt last){ if (first == last) return... 阅读全文
posted @ 2015-09-20 15:46 wxquare 阅读(195) 评论(0) 推荐(0) 编辑
摘要: //give a target,find the closet three number,//and compute the sum of the closet numberint threeClosetSum(int A[],int len,int target){ if (len v(A... 阅读全文
posted @ 2015-09-12 22:28 wxquare 阅读(163) 评论(0) 推荐(0) 编辑
摘要: /**********************************************Function:input two array and find the kth valuethe run time cost is O(log(m+n))************************... 阅读全文
posted @ 2015-09-11 21:20 wxquare 阅读(156) 评论(0) 推荐(0) 编辑
摘要: //定义二维数组int **array = new int*[row_num]; for(int i=0;i> v2(row_num,vector(col_num,0));//删除排好序数组中重复的数据,返回剩余数组的长度//int A[]: input array//len: the arr... 阅读全文
posted @ 2015-09-09 22:16 wxquare 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 摘自:《深入应用C++11》第九章实际中,主要有两种方法处理大量的并发任务,一种是一个请求由系统产生一个相应的处理请求的线程(一对一)另外一种是系统预先生成一些用于处理请求的进程,当请求的任务来临时,先放入同步队列中,分配一个处理请求的进程去处理任务,线程处理完任务后还可以重用,不会销毁,而是等待下... 阅读全文
posted @ 2015-09-02 20:41 wxquare 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 题目:编写一个程序,开启3个线程,这3个线程的ID分别为A、B、C,每个线程将自己的ID在屏幕上打印10遍,要求输出结果必须按ABC的顺序显示;如:ABCABC….依次递推。#include #include #include #include using namespace std;mutex m... 阅读全文
posted @ 2015-08-29 20:06 wxquare 阅读(417) 评论(0) 推荐(0) 编辑
摘要: 参考:《C++11深入应用》用同步阻塞队列解决生产者消费者问题。生产者消费者问题:有一个生产者在生产产品,这些产品将提供给若干个消费者去消费,为了使生产者和消费者能并发执行,在两者之间设置一个有多个缓冲区的缓冲池,生产者将它生产的产品放入一个缓冲区中,消费者可以从缓冲区中取走产品进行消费,所有生产者... 阅读全文
posted @ 2015-08-29 10:29 wxquare 阅读(6385) 评论(0) 推荐(1) 编辑