自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(46)
  • 收藏
  • 关注

原创 28 Implement strStr()

题目链接:https://leetcode.com/problems/implement-strstr/题目:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.解题思路: 看到这道题的第一眼就觉得要用

2015-08-31 19:46:20 267

原创 25 Reverse Nodes in k-Group

题目链接:https://leetcode.com/problems/reverse-nodes-in-k-group/题目:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple

2015-08-29 17:11:51 260

原创 23 Merge k Sorted Lists

题目链接:https://leetcode.com/problems/merge-k-sorted-lists/题目:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.解题思路: 采用的数据结构是优先级队列。 将参加归并的每个链表的头结点都入队列,这样

2015-08-29 16:04:10 435

原创 22 Generate Parentheses

题目链接:https://leetcode.com/problems/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 se

2015-08-28 21:40:24 537

原创 HBase shell 无法使用 Backspace 键-解决方案

在File->Properties->Terminal->Keyboard下,把DELETE/BACKSPACE key sequence选为ASCII 127(Ctrl+?)。

2015-08-28 15:29:28 1679

原创 21 Merge Two Sorted Lists

题目链接:https://leetcode.com/problems/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 list

2015-08-26 21:24:01 363

原创 20 Valid Parentheses

题目链接:https://leetcode.com/problems/valid-parentheses/题目:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in

2015-08-26 20:40:03 406

原创 18 4Sum

题目链接:https://leetcode.com/problems/4sum/题目:Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives

2015-08-26 16:38:30 343

转载 java框架篇---struts之OGNL详解

转载链接:http://www.cnblogs.com/oumyye/p/4361812.htmlOGNL(Object Graph Navigation Language),是一种表达式语言。使用这种表达式语言,你可以通过某种表达式语法,存取Java对象树中的任意属性、调用Java对象树的方法、同时能够自动实现必要的类型转化。如果我们把表达式看做是一个带有语义的字符串,那么OGNL无疑成为了这个语

2015-08-25 20:23:07 439

原创 19 Remove Nth Node From End of List

题目链接:https://leetcode.com/problems/remove-nth-node-from-end-of-list/题目:Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5,

2015-08-25 17:15:34 366

原创 17 Letter Combinations of a Phone Number

题目链接:https://leetcode.com/problems/letter-combinations-of-a-phone-number/题目:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (

2015-08-25 16:29:53 604

原创 16 3Sum Closest

题目链接:https://leetcode.com/problems/3sum-closest/题目:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers

2015-08-25 15:28:03 513

原创 15 3Sum

题目链接:https://leetcode.com/problems/3sum/题目:Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Not

2015-08-24 19:58:12 408

原创 14 Longest Common Prefix

题目链接:https://leetcode.com/problems/longest-common-prefix/题目:Write a function to find the longest common prefix string amongst an array of strings.解题思路: 最初的想法: 先比较前两个字符串,得出一个公共前缀。由于之后的字符串的公共前缀只可能在此基础上

2015-08-22 18:54:25 355

原创 9 Palindrome Number

题目链接:https://leetcode.com/problems/palindrome-number/题目:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindrom

2015-08-22 17:38:32 335

原创 5 Longest Palindromic Substring

题目链接:https://leetcode.com/problems/longest-palindromic-substring/题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists

2015-08-22 16:46:17 307

原创 4 Median of Two Sorted Arrays

题目链接:https://leetcode.com/problems/median-of-two-sorted-arrays/题目:There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run tim

2015-08-21 17:53:02 398

原创 3 Longest Substring Without Repeating Characters

题目链接:https://leetcode.com/problems/longest-substring-without-repeating-characters/题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest sub

2015-08-20 16:49:46 330

原创 2 Add Two Numbers

题目链接:https://leetcode.com/problems/add-two-numbers/题目:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a sing

2015-08-18 17:16:08 592

原创 1 Two Sum

题目链接:https://leetcode.com/problems/two-sum/题目:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers

2015-08-18 16:02:24 316

原创 231 Power of Two

题目链接:https://leetcode.com/problems/power-of-two/题目:Given an integer, write a function to determine if it is a power of two.解题思路: 空闲之余选了一题小菜题活动下筋骨。 本题是判断一个数是否是 2 的幂。那就是说如果一个数是 2 的幂,那它的所有质因子都是 2。首先,能被

2015-08-17 21:09:56 226

原创 26 Remove Duplicates from Sorted Array

题目链接:https://leetcode.com/problems/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 a

2015-08-16 17:17:21 195

原创 66 Plus One

题目链接:https://leetcode.com/problems/plus-one/题目:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the

2015-08-16 16:21:39 723

原创 75 Sort Colors

题目链接:https://leetcode.com/problems/sort-colors/题目:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, w

2015-08-16 15:07:45 423

原创 54 Spiral Matrix

题目链接:https://leetcode.com/problems/spiral-matrix/题目:Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [

2015-08-14 18:31:20 411

原创 59 Spiral Matrix II

题目链接:https://leetcode.com/problems/spiral-matrix-ii/题目:Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should return the foll

2015-08-14 17:06:20 474

原创 64 Minimum Path Sum

题目链接:https://leetcode.com/problems/minimum-path-sum/题目:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its pa

2015-08-14 15:42:28 577

原创 153 Find Minimum in Rotated Sorted Array

题目链接:https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/题目:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Fin

2015-08-12 21:29:42 225

原创 220 Contains Duplicate III

题目链接:https://leetcode.com/problems/contains-duplicate-iii/题目:Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] a

2015-08-12 16:21:43 353

原创 219 Contains Duplicate II

题目链接:https://leetcode.com/problems/contains-duplicate-ii/题目:Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j]

2015-08-12 14:57:35 375

原创 217 Contains Duplicate

题目链接:https://leetcode.com/problems/contains-duplicate/题目:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in t

2015-08-12 13:52:45 354

原创 225 Implement Stack using Queues

题目链接:https://leetcode.com/problems/implement-stack-using-queues/题目:Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top o

2015-08-11 15:59:55 249

原创 102 Binary Tree Level Order Traversal

题目链接:https://leetcode.com/problems/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:

2015-08-11 12:13:50 242

原创 35 Search Insert Position

题目链接:https://leetcode.com/problems/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 inse

2015-08-09 19:36:49 241

原创 48 Rotate Image

题目链接:https://leetcode.com/problems/rotate-image/题目:You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?解题思路:1 2 3

2015-08-09 17:26:19 296

原创 27 Remove Element

题目链接:https://leetcode.com/problems/remove-element/题目:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't m

2015-08-08 18:37:13 306

原创 53 Maximum Subarray

题目链接:https://leetcode.com/problems/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

2015-08-08 17:34:52 234

原创 202 Happy Number

题目链接:https://leetcode.com/problems/happy-number/题目:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer

2015-08-08 16:52:10 293

原创 152 Maximum Product Subarray

题目链接:https://leetcode.com/problems/maximum-product-subarray/题目:Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [

2015-08-07 20:07:21 908

原创 238 Product of Array Except Self

题目链接:https://leetcode.com/problems/reverse-linked-list/题目:Reverse a singly linked list.click to show more hints.Hint:A linked list can be reversed either iteratively or recursively. Could you implemen

2015-08-07 16:39:31 288

空空如也

空空如也

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

TA关注的人

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