自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 问答 (1)
  • 收藏
  • 关注

原创 LeetCode 46. Permutations

Given a collection of distinct numbers, return all possible permutations.For example, [1,2,3] have the following permutations:[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]给出数列列

2017-12-28 01:53:42 164

原创 java 将数组转化为 二叉树

class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }private TreeNode createBinaryTreeByArray(Integer []array,int index)

2017-12-25 01:57:26 7864 2

原创 LeetCode 102. Binary Tree Level Order Traversal

Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).For example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 /

2017-12-25 01:54:18 157

原创 LeetCode 279. Perfect Squares

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n.For example, given n = 12, return 3 because 12 = 4 + 4 + 4; given n = 13, return

2017-12-24 02:19:45 177

原创 LeetCode 120. Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [6,5,7],

2017-12-23 00:41:27 141

原创 LeetCode 101. Symmetric Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the

2017-12-20 00:31:56 150

原创 flume文件下沉 kafka相关命令

1.flume配置文件kfk.conf# Describe/configure the sourcea1.sources.r1.type = execa1.sources.r1.command = tail -F /home/hadoop/tmp/test.txt# Describe the sinka1.sinks.k1.type = org.apache.flume.sink.kafka.

2017-12-19 15:25:49 889 2

转载 Java中Comparable和Comparator区别小结

一、Comparable简介  Comparable是排序接口。若一个类实现了Comparable接口,就意味着该类支持排序。实现了Comparable接口的类的对象的列表或数组可以通过Collections.sort或Arrays.sort进行自动排序。  此外,实现此接口的对象可以用作有序映射中的键或有序集合中的集合,无需指定比较器。该接口定义如下:package java.lang;impo

2017-12-19 00:57:10 163

原创 tail -f 失效

创建文件 test.txt,使用tail -f 监听当vim 编辑文件保存的时候,tail -f 没有反应但是直接echo xxxx >>test.txt就可以生效很奇怪,于是上网,看到如下解释有些编辑器在保存的时候会删掉原来的文件,重新创建一个的,比如 vim应该就是这样造成的

2017-12-18 12:49:42 457

原创 LeetCode 42. Trapping Rain Water

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1], ret

2017-12-16 00:57:37 140

原创 LeetCode 41. First Missing Positive

Given an unsorted integer array, find the first missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant space.难点

2017-12-15 01:33:20 137

转载 Linux下的tar压缩解压缩命令详解

tar-c: 建立压缩档案 -x:解压 -t:查看内容 -r:向压缩归档文件末尾追加文件 -u:更新原压缩包中的文件这五个是独立的命令,压缩解压都要用到其中一个,可以和别的命令连用但只能用其中一个。下面的参数是根据需要在压缩或解压档案时可选的。-z:有gzip属性的 -j:有bz2属性的 -Z:有compress属性的 -v:显示所有过程 -O:将文件解开到标准输出下面的参数-f是必

2017-12-14 16:39:43 222

原创 Leetcode 39. Combination Sum

Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C

2017-12-14 00:41:01 201

原创 关于rpm 和 yum整理

一.什么是yum   yum = Yellow dog Updater, Modified主要功能是更方便的添加/删除/更新RPM包.它能自动解决包的倚赖性问题.   它能便于管理大量系统的更新问题二.yum特点   *可以同时配置多个资源库(Repository)   *简洁的配置文件(/etc/yum.conf)   *自动解决增加或删除rpm包时遇到的倚赖性问题   *使用方便

2017-12-12 17:33:54 204

转载 storm ack机制

1、先看一下数学中的异或 异或xor是一个数学运算符。它应用于逻辑运算。异或符号为“^”。 异或也叫半加运算,其运算法则相当于不带进位的二进制加法:二进制下用1表示真,0表示假,则异或的运算法则为:0异或0=0,1异或0=1,0异或1=1,1异或1=0(同为0,异为1), 既然相同的对象XOR操作,结果是0,那么有这样一个公式, A xor B…xor B xor A = 0,其中每

2017-12-09 15:37:39 237

原创 LeetCode 31. Next Permutation

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible orde

2017-12-08 12:52:25 133

原创 LeetCode 29. Divide Two Integers

Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.没有使用移位,而是采取了小学竖式计算的原理 public int divide(int dividend, int divisor) { long dividend_l

2017-12-07 17:00:56 127

原创 Storm集群安装

vim storm.yaml#指定storm使用的zk集群storm.zookeeper.servers: - "master" - "work1" - "work2"#指定storm集群中的nimbus节点所在的服务器nimbus.host: "master"#指定nimbus启动JVM最大可用内存大小nimbus.childopts: "-Xmx1024m

2017-12-07 16:57:42 202

原创 22. Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ “((()))”, “(()())”, “(())()”, “()(())”,

2017-12-03 16:21:11 120

原创 Hbase集群安装配置

hbase-env.sh 我就配置了如下参数export JAVA_HOME=/usr/jdkexport JAVA_CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarexport HBASE_OPTS="-XX:+UseConcMarkSweepGC"# Tell HBase whether it should manage

2017-12-03 00:09:53 181

原创 17. Letter Combinations of a Phone Number

运用到了队列的思想,但实际代码直接用list实现了public List<String> letterCombinations(String digits) { List<String> resultList = new ArrayList<String>(); //初始化号码对应的英文字母 String[] phoneDic = new String

2017-12-01 22:59:45 144

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除