04 2014 档案

摘要: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 阅读(639) 评论(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 阅读(676) 评论(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 阅读(241) 评论(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 阅读(137) 评论(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 阅读(152) 评论(0) 推荐(0) 编辑
摘要:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".题解:用栈就行了代码: 1 class Solution {... 阅读全文
posted @ 2014-04-28 16:35 SunshineAtNoon 阅读(145) 评论(0) 推荐(0) 编辑
摘要:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl... 阅读全文
posted @ 2014-04-28 16:14 SunshineAtNoon 阅读(150) 评论(0) 推荐(0) 编辑
摘要:The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie... 阅读全文
posted @ 2014-04-28 15:34 SunshineAtNoon 阅读(296) 评论(0) 推荐(0) 编辑
摘要:发现自己不写总结真是件很恶劣的事情,好多学的东西没有自己总结都忘记了。所以决定从今天开始,学东西的时候一定跟上总结。我写的东西大多数是自己通俗的总结,不太喜欢写严格的定义或者证明,写了也记不住,欢迎指正。1. High Bias vs. High Variance High Bias:通常是因为模... 阅读全文
posted @ 2014-04-28 00:16 SunshineAtNoon 阅读(861) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].Note:Recursive solution is trivial, could you do it iteratively?解题:果然不能晚上做题,效率好低。看了讨论才学会的解法。设置一个指针next指向当前访问的节点,如果它不为空,就把它压栈,并且下一个访问它的左节点;如果它为空,就从栈顶一定是它的父... 阅读全文
posted @ 2014-04-03 00:16 SunshineAtNoon 阅读(157) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].Not... 阅读全文
posted @ 2014-04-02 15:55 SunshineAtNoon 阅读(201) 评论(0) 推荐(0) 编辑
摘要:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?解题:开始进入一个误区,跟循环链表搞混了,其实这个环的开头可以不在head这里,例如... 阅读全文
posted @ 2014-04-02 10:37 SunshineAtNoon 阅读(208) 评论(0) 推荐(0) 编辑
摘要:Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1 3 3 2 1 \ / / / \ \ 3 2 1 1 3 2 / / \ \ 2 1 ... 阅读全文
posted @ 2014-04-01 21:20 SunshineAtNoon 阅读(175) 评论(0) 推荐(0) 编辑
摘要:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
posted @ 2014-04-01 17:05 SunshineAtNoon 阅读(216) 评论(0) 推荐(0) 编辑
摘要:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321解题:设定一个变量sum存放反转后的答案,每次取输入x的最后一位n,并用sum = sum*10+n更新sum。例如题设的数字123,初始sum为0,过程如下:取末尾的3,sum=3,x=12取末尾的2,sum=32,x=1取末尾的1,sum=321,x=0特别注意x一开始就是0的处理,直接返回0就可以了。代码: 1 class Solution { 2 public: 3 int reverse(int x) {... 阅读全文
posted @ 2014-04-01 11:14 SunshineAtNoon 阅读(151) 评论(0) 推荐(0) 编辑
摘要:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an... 阅读全文
posted @ 2014-04-01 10:58 SunshineAtNoon 阅读(182) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示