自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

筑梦者

努力ing

  • 博客(38)
  • 资源 (2)
  • 收藏
  • 关注

原创 LeetCode-Easy刷题(33) Min Stack

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get

2017-11-30 19:23:42 445

原创 LeetCode-Easy刷题(32) Linked List Cycle

Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?给定一个链表,确定它是否有一个循环。  你能在不使用额外空间的情况下解决它吗? //两个速度指针 public boolean hasC

2017-11-30 19:22:51 326

原创 LeetCode-Easy刷题(31) Single Number

Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using extra

2017-11-30 19:22:15 291

原创 LeetCode-Easy刷题(30) Best Time to Buy and Sell Stock II

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one

2017-11-30 19:21:28 284

原创 LeetCode-Easy刷题(29) Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), d

2017-11-30 19:20:37 296

原创 LeetCode-Easy刷题(28) Pascal's Triangle II

Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to use only O(k) extra space?给定一个索引k,返回帕斯

2017-11-30 19:19:47 272

原创 LeetCode-Easy刷题(27) Pascal's Triangle

Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]给定numRows,生成帕斯卡三角形的第一个num

2017-11-30 19:19:05 261

原创 LeetCode-Easy刷题(26) Path Sum

Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree and sum

2017-11-30 19:18:08 261

原创 LeetCode-Easy刷题(25) Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.找出二叉树的最小深度. //深度优先 维护最小

2017-11-30 19:17:14 243

原创 LeetCode-Easy刷题(24) Balanced Binary Tree

Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never dif

2017-11-30 19:16:27 214

原创 LeetCode-Easy刷题(23) Convert Sorted Array to Binary Search Tree

Given an array where elements are sorted in ascending order, convert it to a height balanced BST.将有序数组转化为二分查找树 public TreeNode sortedArrayToBST(int[] nums) { return toBSTHelp(nu

2017-11-29 18:49:07 240

原创 LeetCode-Easy刷题(22)Binary Tree Level Order Traversal II

Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree [3,9,20,null,null,1

2017-11-29 18:48:24 258

原创 LeetCode-Easy刷题(21) Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.找出二叉树的最大深度. public int

2017-11-29 18:47:32 217

原创 LeetCode-Easy刷题(20) 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 3B

2017-11-29 18:45:56 290

原创 LeetCode-Easy刷题(19) Same Tree

Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the same value.Exampl

2017-11-29 18:45:12 192

原创 LeetCode-Easy刷题(18) Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold add

2017-11-29 18:44:17 198

原创 LeetCode-Easy刷题(17) Remove Duplicates from Sorted List

Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.删除排好序链表中重复的数字.返回一个数字不

2017-11-29 18:43:25 213

原创 LeetCode-Easy刷题(16) Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n will be a positive

2017-11-29 18:42:47 206

原创 LeetCode-Easy刷题(15) Sqrt(x)

Implement int sqrt(int x).Compute and return the square root of x.x is guaranteed to be a non-negative integer.Example 1:Input: 4Output: 2Example 2:Input: 8Output: 2Explanation: The

2017-11-29 18:41:48 156

原创 LeetCode-Easy刷题(14) Add Binary

Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".二进制字符串相加返回结果字符串 //维护一个进位指针 public static String addBinary(String a, St

2017-11-28 18:16:04 225

原创 LeetCode-Easy刷题(13) Plus One

Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except the number 0 itself.The digits a

2017-11-28 18:14:59 193

原创 LeetCode-Easy刷题(12) Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is def

2017-11-28 18:13:58 149

原创 LeetCode-Easy刷题(11) Maximum Subarray

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,-5,4],the contiguous subarray [4,-1,2,1] has

2017-11-28 18:13:05 246

原创 LeetCode-Easy刷题(10) Search Insert Position

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 order.You may assume no duplicates in the array.

2017-11-28 12:12:45 195

原创 LeetCode-Easy刷题(9) Implement strStr()

Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Example 1:Input: haystack = "hello", needle = "ll"Output: 2Example

2017-11-28 12:11:26 192

原创 LeetCode-Easy刷题(8) Remove Element

Given an array and a value, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the input array in-pl

2017-11-28 12:09:46 182

原创 LeetCode-Easy刷题(7) Remove Duplicates from Sorted Array

Given a sorted array, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this by modifying

2017-11-28 12:08:34 198

原创 LeetCode-Easy刷题(6) Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.合并两个排序链表,并将其作为一个新列表返回。新的列表应该通过将前两个列表的节点拼接在一起。

2017-11-27 20:14:43 154

原创 LeetCode-Easy刷题(5) Valid Parentheses

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all vali

2017-11-27 20:13:38 193

原创 LeetCode-Easy刷题(4) Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings.输入一组字符串的公共最长子串 public static String longestCommonPrefix(String[] strs) { if(strs ==null ||

2017-11-27 20:12:38 197

原创 LeetCode-Easy刷题(3) Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space.判断一个整数是否为回文(对称)。这样做没有多余的空间。 public boolean isPalindrome(int x) { if(x == Integer.MAX_VALUE || x

2017-11-27 20:11:05 197

原创 LeetCode-Easy刷题(2) Reverse Integer

Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume we are deal

2017-11-27 20:08:56 177

原创 LeetCode-Easy刷题(1) Two Sum

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 exactly one solution, and you may not use the same e

2017-11-27 20:05:46 229

转载 Storm概念、原理详解及其应用(二)Storm Cluster

前述:本章内容借鉴官文和一些资料,有问题的地方希望大家指出。同样,内容中不会给出部署Storm集群的方法和步骤,因为部署只是我们使用它的基础,个人认为集群部署维护属于运维层面;也不会详解Command line client;更不会贴出yaml配置文件。所以不包含上述内容,希望不会浪费到大家时间。那文章内容会有什么呢?在完成上述工作以后,却不理解Storm是如何通过storm.

2017-11-02 21:00:30 417

转载 Storm概念、原理详解及其应用(一)BaseStorm

本文借鉴官文,添加了一些解释和看法,其中有些理解,写的比较粗糙,有问题的地方希望大家指出。写这篇文章,是想把一些官文和资料中基础、重点拿出来,能总结出便于大家理解的话语。与大多数“wordcount”代码不同的是,并不会有如何运行第一storm代码等内容,只有在运行完代码后,发现需要明白:“知其然,并知其所以然”。Storm是什么?为什么要用Storm?为什么不用Spark?

2017-11-02 20:58:08 369

原创 Storm安装和使用Demo

一,Storm集群的安装1.下载安装包:wget http://archive.apache.org/dist/storm/apache-storm-0.9.7/apache-storm-0.9.7.tar.gz2.解压移动到软件安装目录tar -zxvf   xxxx3.修改配置文件,conf目录下:vim storm.yaml

2017-11-02 17:00:18 684

转载 Hbase原理、基本概念、基本架构

概述HBase是一个构建在HDFS上的分布式列存储系统;HBase是基于Google BigTable模型开发的,典型的key/value系统;HBase是Apache Hadoop生态系统中的重要一员,主要用于海量结构化数据存储;从逻辑上讲,HBase将数据按照表、行和列进行存储。与hadoop一样,Hbase目标主要依靠横向扩展,通过不断增加廉价的商用服务器,来增加计算和存储

2017-11-02 10:27:06 349

原创 Hadoop入门之Hbase得安装和简单Shell使用

一,HBase安装(HBase依赖Hadoop集群 )1.安装Zookeeper集群参考此篇中ZK集群搭建过程:http://blog.csdn.net/sqh201030412/article/details/513964272.HBase集群搭建下载安装包:wget http://archive.apache.org/dist/h

2017-11-01 15:46:27 423

空空如也

空空如也

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

TA关注的人

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