自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(82)
  • 收藏
  • 关注

原创 【LeetCode OJ 101】Symmetric Tree

题目链接:https://leetcode.com/problems/symmetric-tree/题目:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric:

2016-04-01 15:17:38 732

原创 【LeetCode OJ 075】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 r

2016-03-27 12:59:55 800

原创 剑指offer03:二维数组中的查找

/** * @Description 在一个二维数组中,每一行都从左到右递增的顺序,每一列都是按照从上到下递增的顺序,完成一个函数,判断数组中是否包含指定的数 * @author 徐剑 * @date 2016年3月19日 下午4:28:31 * @version V1.0 */public class FindTheNumber{ public static boolean

2016-03-19 16:34:27 462

原创 【LeetCode OJ 073】Set Matrix Zeroes

题目链接:https://leetcode.com/problems/set-matrix-zeroes/题目:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.Follow up:Did you use extra space?A str

2016-03-13 20:08:20 1066

原创 【LeetCode OJ 090】Subsets II

题目链接:https://leetcode.com/problems/subsets-ii/题目:Given a collection of integers that might contain duplicates, nums, return all possible subsets.Note:Elements in a subset must be in non-

2016-03-12 14:48:58 1025

原创 【LeetCode OJ 078】Subsets

题目链接:https://leetcode.com/problems/subsets/题目:Given a set of distinct integers, nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution s

2016-03-12 14:42:41 1088

原创 【LeetCode OJ 268】Missing Number

题目链接:https://leetcode.com/problems/missing-number/题目:Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given 

2016-03-02 21:30:07 968

原创 【LeetCode OJ 328】Odd Even Linked List

题目链接:https://leetcode.com/problems/odd-even-linked-list/题目:Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node numbe

2016-03-02 17:09:53 1026

原创 【LeetCode OJ 061】Rotate List

题目链接:https://leetcode.com/problems/rotate-list/题目:Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4

2016-03-01 15:08:10 730

原创 【LeetCode OJ 203】Remove Linked List Elements

题目链接:https://leetcode.com/problems/remove-linked-list-elements/题目:Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, va

2016-02-28 19:53:34 1018

原创 【LeetCode OJ 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

2016-02-26 10:17:41 1210

原创 【LeetCode OJ 232】Implement Queue using Stacks

题目链接:https://leetcode.com/problems/implement-queue-using-stacks/题目:Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the

2016-02-25 21:02:13 1194

原创 【LeetCode OJ 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

2016-02-23 20:54:39 835

原创 【LeetCode OJ 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.解题思路:寻找字符串数组的最长公共前缀,将数组的第一个元素作为默认公共前缀,依次与后面的元素进行比较

2016-02-23 20:21:55 1177 1

原创 【LeetCode OJ 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.解题思路:题意为在字符

2016-01-26 16:53:20 1039 1

原创 【LeetCode OJ 260】Single Number III

题目链接:https://leetcode.com/problems/single-number-iii/题目:Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two

2016-01-25 16:30:53 1714 3

原创 【LeetCode OJ 41】First Missing Positive

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

2016-01-25 09:18:28 695

原创 【LeetCode OJ 136】Single Number

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

2016-01-21 16:11:36 2499

原创 【LeetCode OJ 34】Search for a Range

题目链接:https://leetcode.com/problems/search-for-a-range/题目:Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must

2016-01-21 11:06:51 1170

原创 【LeetCode OJ 237】Delete Node in a Linked List

题目链接:https://leetcode.com/problems/delete-node-in-a-linked-list/题目:Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked

2016-01-20 15:03:51 1330

原创 【LeetCode OJ 263】Ugly Number

题目链接:https://leetcode.com/problems/ugly-number/题目:Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Fo

2016-01-19 22:01:13 1414

原创 【LeetCode OJ 016】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 in

2016-01-19 21:20:17 989

原创 【LeetCode OJ 242】Valid Anagram

题目链接:https://leetcode.com/problems/valid-anagram/题目:Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true

2016-01-18 19:53:18 1298

原创 【LeetCode OJ 258】Add Digits

题目链接:https://leetcode.com/problems/add-digits/题目:Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the pro

2016-01-15 20:18:50 816

原创 【Java并发编程一】线程安全

什么是线程安全?当多个线程访问一个类时,如果不用考虑这些线程在运行时环境下的调度和交替执行,并且不需要额外的同步及在调用代码代码不必作其他的协调,这个类的行为仍然是正确的,那么称这个类是线程安全的。内部锁Java提供了强制性的内置锁机制:synchronized块。一个synchronized块有两个部分:锁对象的引用,以及这个锁保护的代码块。执行线程进入synchronized块

2015-11-27 15:11:34 617

原创 Java static关键字

概述本文将讨论Java static关键字的使用。它可以被用于类名、变量、方法和块。静态类只有当一个类为嵌套类时才能使用static,这个嵌套类可以不使用外部类的对象就可以访问。例子:public class TestMain{ static class X { static String str="Inside Class X"; } public static v

2015-11-26 10:59:57 464

原创 Android数据存储

持久化技术android系统中主要提供了三种方式用于简单的实现数据持久化功能,即文件存储、SharePreference存储以及数据库存储。文件存储文件存储是Android中最基本的一种数据存储技术方式,它不对存储的内容进行任何的格式处理,所有的数据都是原封不动的保存到文件当中,比较适合用于存储一些简单的文本数据或二进制数据。1、存文件 Context类提供了一个openFileOutput方法,

2015-11-24 11:27:27 392

原创 【LeetCode OJ 016】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 in

2015-11-23 15:39:34 385

原创 【LeetCode OJ 015】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

2015-11-23 11:05:25 560

原创 【LeetCode OJ 011】Container With Most Water

链接:https://leetcode.com/problems/container-with-most-water/题目:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn s

2015-11-22 13:17:42 633

原创 【LeetCode OJ 009】Palindrome Number

题目链接:https://leetcode.com/problems/palindrome-number/题目:Determine whether an integer is a palindrome. Do this without extra space.Could negative integers be palindromes? (ie, -1)If you are

2015-11-20 20:27:59 476

原创 【LeetCode OJ 228】Summary Ranges

题目链接:https://leetcode.com/problems/summary-ranges/题目:Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return ["0->2","4->5"

2015-11-20 09:49:28 491

原创 【LeetCode OJ 007】Reverse Integer

题目链接:https://leetcode.com/problems/reverse-integer/题目:Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321Have you thought about this?Here are

2015-11-16 20:31:38 1262

原创 【LeetCode OJ 005】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

2015-11-07 20:54:34 495

原创 【LeetCode OJ 004】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 ru

2015-11-06 09:07:13 1124

原创 【LeetCode OJ 003】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

2015-11-05 20:27:42 1033

原创 Hibernate系列之Id生成策略

一、概述  hibernate中使用两种方式实现主键生成策略,分别是XML生成id和注解方式(@GeneratedValue),下面逐一进行总结。二、XML配置方法  这种方式是在XX.hbm.xml文件中对generator进行配置,eg:xml version="1.0"?>DOCTYPE hibernate-mapping PUBLIC

2015-10-15 21:32:46 483

原创 Hibernate系列之基本配置

一、概述  Hibernate是一个开放源码的对象关系映射框架,它对JDBC进行了非常轻量级的对象封装,使我们可以使用对象的编程思维来操作数据库。二、配置准备  IDE:Eclipse  下载Jar包:  三、配置步骤  1、创建新的Java项目    2、建立用户库-hibernate,引入相应的jar包项目右键-b

2015-09-14 16:55:13 459

原创 Java垃圾回收机制

一、概述  上一篇文章Java内存模型提到虚拟机所管理的内存主要包括以下几个区域:程序计数器、虚拟机栈、本地方法栈、方法区和堆。其中前三个区域随线程而生死,这些区域的内存分配和回收都具有确定性。而堆和方法区则具有不确定性,只有程序处于运行期间才能知道会创建哪些对象,本文主要讨论这两个部分内存的回收。二、Java内存管理  Java的内存管理就是对象的分配和释放问题。在Jav

2015-09-06 14:35:20 423

原创 Java内存模型

一、概述  Java虚拟机在执行Java程序的过程中会把它所管理的内存划分为若干不同的数据区域,这些区域都有各自的用途以及创建和销毁的时间。Java虚拟机所管理的内存将会包括以下几个运行时数据区域,如下图所示:  下面就每一个区域进行阐述。回到顶部二、运行时数据区域程序计数器  程序计数器,可以看做是当前线程所执行的字节码的行号指示器。在虚拟

2015-07-28 09:11:49 572

空空如也

空空如也

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

TA关注的人

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