上一页 1 2 3 4 5 6 7 8 ··· 18 下一页
摘要: Given an encoded string, return it's decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is b 阅读全文
posted @ 2017-04-01 21:47 Pickle 阅读(572) 评论(0) 推荐(0) 编辑
摘要: Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard 阅读全文
posted @ 2017-02-11 17:44 Pickle 阅读(307) 评论(0) 推荐(0) 编辑
摘要: AtomicInteger可以看做Integer类的原子操作工具类。在java.util.concurrent.atomic包下,在一些使用场合下可以取代加锁操作提高并发性。接下来就从几个方面来介绍: 1.原子性和CAS。 2.CPU底层实现原理。 3.atomic包介绍。 4.源码分析。 原子性和 阅读全文
posted @ 2017-01-22 19:37 Pickle 阅读(1279) 评论(0) 推荐(3) 编辑
摘要: Given a binary array, find the maximum number of consecutive 1s in this array. 阅读全文
posted @ 2017-01-20 11:31 Pickle 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. 阅读全文
posted @ 2017-01-20 11:15 Pickle 阅读(306) 评论(0) 推荐(0) 编辑
摘要: The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calcul 阅读全文
posted @ 2017-01-20 10:31 Pickle 阅读(218) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文
posted @ 2017-01-20 10:14 Pickle 阅读(281) 评论(0) 推荐(0) 编辑
摘要: Integer是平时开发中最常用的类之一,但是如果没有研究过源码很多特性和坑可能就不知道,下面深入源码来分析一下Integer的设计和实现。 Integer: 继承结构: -java.lang.Object --java.lang.Number java.lang.Integer 其中父类Numbe 阅读全文
posted @ 2017-01-19 19:02 Pickle 阅读(3867) 评论(1) 推荐(5) 编辑
摘要: 命令行操作: -help 功能:输出这个命令参数手册 -ls 功能:显示目录信息 示例: hadoop fs -ls hdfs://hadoop-server01:9000/ 备注:这些参数中,所有的hdfs路径都可以简写 -->hadoop fs -ls / 等同于上一条命令的效果 -mkdir 阅读全文
posted @ 2017-01-12 17:31 Pickle 阅读(5458) 评论(1) 推荐(2) 编辑
摘要: 深入理解一个技术的工作机制是灵活运用和快速解决问题的根本方法,也是唯一途径。对于HDFS来说除了要明白它的应用场景和用法以及通用分布式架构之外更重要的是理解关键步骤的原理和实现细节。在看这篇博文之前需要对HDFS以及分布式系统有一些了解。请参考这篇博客。本篇博文首先对HDFS的重要特性和使用场景做一 阅读全文
posted @ 2017-01-11 08:59 Pickle 阅读(26507) 评论(4) 推荐(31) 编辑
摘要: 要想深入学习HDFS就要先了解其设计思想和架构,这样才能继续深入使用HDFS或者深入研究源代码。懂得了“所以然”才能在实际使用中灵活运用、快速解决遇到的问题。下面这篇博文我们就先从一般的分布式谈起,在宏观上逐步去探究HDFS的设计思想和架构实现。 一.先谈分布式 分布式是近几年非常火的技术概念,无论 阅读全文
posted @ 2017-01-10 11:35 Pickle 阅读(5713) 评论(1) 推荐(4) 编辑
摘要: 等概率不重复的生成随机数应该是在平时开发中常见的,也是面试中常问的基础之一。有多种实现方式,有人人都可以想到的,也有不容易想到的巧妙算法,那么当有人问你哪个实现方式更好的时候你该怎么回答呢?回答巧妙的算法比普通算法好?答案显而易见,首先要搞清楚应用场景和要解决的问题。这样才能判断一个算法或者方案的合 阅读全文
posted @ 2016-12-29 17:04 Pickle 阅读(5467) 评论(2) 推荐(2) 编辑
摘要: 在互联网时代HTTP协议的重要性无需多言,对于技术岗位的同学们来说理解掌握HTTP协议是必须的。本篇博客就从HTTP协议的演进、特性、重要知识点和工作中常见问题的总结等方面进行简单的介绍。理解掌握了这些点工作中就OK了,当然在面试中也是少不了的,如果能结合实践掌握这篇博客的80%应对一般的面试应该是 阅读全文
posted @ 2016-12-23 17:13 Pickle 阅读(57855) 评论(12) 推荐(129) 编辑
摘要: Zookeeper作为分布式系统的底层协调服务有着其简单可依靠的数据模型,数据模型加之数据同步、一致性处理和可靠性,在此之上有很多经典的应用,例如,分布式锁、服务器动态上线下感知、主节点选举、数据发布与订阅、负载均衡等等。虽然应用场景很多,但是最根本的还是基于两个核心的服务,1.管理和存储数据结点, 阅读全文
posted @ 2016-12-14 16:35 Pickle 阅读(2789) 评论(0) 推荐(4) 编辑
摘要: Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: Note: You may assume the 阅读全文
posted @ 2016-10-18 21:07 Pickle 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of the numbe 阅读全文
posted @ 2016-10-18 21:00 Pickle 阅读(338) 评论(0) 推荐(0) 编辑
摘要: Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2. Note: 阅读全文
posted @ 2016-10-09 20:14 Pickle 阅读(369) 评论(0) 推荐(0) 编辑
摘要: Find the sum of all left leaves in a given binary tree. Example: 阅读全文
posted @ 2016-10-09 18:46 Pickle 阅读(404) 评论(0) 推荐(0) 编辑
摘要: Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at 阅读全文
posted @ 2016-10-09 00:09 Pickle 阅读(250) 评论(0) 推荐(0) 编辑
摘要: Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example:Given a = 1 and b = 2, return 3. 参考: http://bl 阅读全文
posted @ 2016-10-08 23:58 Pickle 阅读(1172) 评论(0) 推荐(0) 编辑
摘要: Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 阅读全文
posted @ 2016-10-08 23:51 Pickle 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 在数组中的两个数字,如果前面一个数字大于后面的数字,则这两个数字组成一个逆序对。输入一个数组,求出这个数组中的逆序对的总数P。并将P对1000000007取模的结果输出。 即输出P%1000000007 利用归并排序的思想: 归并排序的改进,把数据分成前后两个数组(递归分到每个数组仅有一个数据项), 阅读全文
posted @ 2016-10-05 19:55 Pickle 阅读(518) 评论(0) 推荐(0) 编辑
摘要: 请设计一个函数,用来判断在一个矩阵中是否存在一条包含某字符串所有字符的路径。路径可以从矩阵中的任意一个格子开始,每一步可以在矩阵中向左,向右,向上,向下移动一个格子。如果一条路径经过了矩阵中的某一个格子,则该路径不能再进入该格子。 例如 a b c e s f c s a d e e 矩阵中包含一条 阅读全文
posted @ 2016-10-05 17:26 Pickle 阅读(1259) 评论(0) 推荐(0) 编辑
摘要: 地上有一个m行和n列的方格。一个机器人从坐标0,0的格子开始移动,每一次只能向左,右,上,下四个方向移动一格,但是不能进入行坐标和列坐标的数位之和大于k的格子。 例如,当k为18时,机器人能够进入方格(35,37),因为3+5+3+7 = 18。但是,它不能进入方格(35,38),因为3+5+3+8 阅读全文
posted @ 2016-10-05 16:58 Pickle 阅读(958) 评论(0) 推荐(0) 编辑
摘要: 给定一个数组和滑动窗口的大小,找出所有滑动窗口里数值的最大值。例如,如果输入数组{2,3,4,2,6,2,5,1}及滑动窗口的大小3,那么一共存在6个滑动窗口,他们的最大值分别为{4,4,6,6,6,5}; 针对数组{2,3,4,2,6,2,5,1}的滑动窗口有以下6个: {[2,3,4],2,6, 阅读全文
posted @ 2016-10-05 11:03 Pickle 阅读(1618) 评论(0) 推荐(1) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 18 下一页