2015年4月18日
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1... 阅读全文
posted @ 2015-04-18 20:04 黄瓜小肥皂 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑