上一页 1 ··· 5 6 7 8 9 10 11 下一页
  2015年4月18日
摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the ... 阅读全文
posted @ 2015-04-18 19:59 黄瓜小肥皂 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.首先,学习一下罗马数字,参考罗马数字罗马数字是最古老的数字表示方式,比阿拉伯数组早200... 阅读全文
posted @ 2015-04-18 19:38 黄瓜小肥皂 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 八皇后是一个经典问题,在8*8的棋盘上放置8个皇后,每一行不能互相攻击。因此 拓展出 N皇后问题。下面慢慢了解解决这些问题的方法:回溯法:回溯算法也叫试探法,它是一种系统地搜索问题的解的方法。回溯算法的基本思想是:从一条路往前走,能进则进,不能进则退回来,换一条路再试。在现实中,有很多问题往往需要我... 阅读全文
posted @ 2015-04-18 18:57 黄瓜小肥皂 阅读(743) 评论(0) 推荐(1) 编辑
摘要: II:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.问题是求N皇后的解,可以采用回溯法解决。 1 c... 阅读全文
posted @ 2015-04-18 16:56 黄瓜小肥皂 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Hive是基于Hadoop文件系统上的数据仓库架构。Hive是基于Hadoop的一个数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供类SQL查询功能。本质是将SQL转换为MapReduce程序它为数据仓库的管理提供了许多功能: 数据ETL(抽取,转换和加载)工具 数据存储管理 大型数据... 阅读全文
posted @ 2015-04-18 11:07 黄瓜小肥皂 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 之前了解过Yarn,这次再初步了解下 Hbase和Hive。HBase:HBase是Apache Hadoop的数据库,能够对大型数据提供随机、实时的读写访问。HBase是一个开源的、分布式的、多版本的、面向列的存储模型。HBase存储的是松散型数据。HBase存储的数据从逻辑上来看就像一张很大的表... 阅读全文
posted @ 2015-04-18 10:29 黄瓜小肥皂 阅读(139) 评论(0) 推荐(0) 编辑
  2015年4月10日
摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or... 阅读全文
posted @ 2015-04-10 18:46 黄瓜小肥皂 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 第一次接触Hadoop的时候,启动hadoop出现的节点是:NameNodeSecondaryNameNodeJobTrackerTaskTrackerDataNodeNameNode如今启动hadoop出现的节点是:SecondaryNameNodeNodeManagerResourceManag... 阅读全文
posted @ 2015-04-10 12:56 黄瓜小肥皂 阅读(2393) 评论(0) 推荐(0) 编辑
摘要: struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next... 阅读全文
posted @ 2015-04-10 00:30 黄瓜小肥皂 阅读(160) 评论(0) 推荐(0) 编辑
  2015年4月8日
摘要: 与前面的先序遍历相似。此题为后序遍历。C++: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *rig... 阅读全文
posted @ 2015-04-08 22:27 黄瓜小肥皂 阅读(117) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 下一页