摘要: Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie... 阅读全文
posted @ 2014-05-16 16:21 SunshineAtNoon 阅读(268) 评论(0) 推荐(0) 编辑
摘要: Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi... 阅读全文
posted @ 2014-05-16 11:07 SunshineAtNoon 阅读(192) 评论(0) 推荐(0) 编辑
摘要: A square pattern of size N x N (1 20 #include 21 #include 22 using namespace std; 23 24 //旋转90度的操作 25 int **transiformation_one(int before[][11],i... 阅读全文
posted @ 2014-05-15 11:13 SunshineAtNoon 阅读(303) 评论(0) 推荐(0) 编辑
摘要: Three farmers rise at 5 am each morning and head for the barn to milk three cows. The first farmer begins milking his cow at time 300 (measured in sec... 阅读全文
posted @ 2014-05-14 12:15 SunshineAtNoon 阅读(365) 评论(0) 推荐(0) 编辑
摘要: 做exploratory data annalysis的作业,差点被虐死了,R从头开始,边做边学,最后搞到一点多才弄完,还有一个图怎么画都不对,最后发现是数据读取的时候有问题。用来画图的数据来自:http://archive.ics.uci.edu/ml/datasets/Individual+ho... 阅读全文
posted @ 2014-05-13 17:15 SunshineAtNoon 阅读(1096) 评论(0) 推荐(0) 编辑
摘要: 1. 下载YCSB 0.1.3:wget https://github.com/brianfrankcooper/YCSB/archive/0.1.3.tar.gz如果提示“wget:命令没找到”,那么需要先运行yum -y install wget安装wget2. 解压缩:tar zxvf 0.1... 阅读全文
posted @ 2014-04-29 23:41 SunshineAtNoon 阅读(632) 评论(0) 推荐(0) 编辑
摘要: 基础配置:Hadoop 2.2.0,Hbase 0.96。四台集群机器,一台master,三台slave。三台slave上分别装gmond;namenode机器上设置datasource。客户端:安装wget:sudo yum -y install wget安装epel库: a) 下载epel r... 阅读全文
posted @ 2014-04-29 23:25 SunshineAtNoon 阅读(675) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文
posted @ 2014-04-29 21:01 SunshineAtNoon 阅读(238) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe... 阅读全文
posted @ 2014-04-29 17:32 SunshineAtNoon 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ],... 阅读全文
posted @ 2014-04-29 10:40 SunshineAtNoon 阅读(150) 评论(0) 推荐(0) 编辑