Java单例详解

本文转载自以下两篇 singleton模式四种线程安全的实现   http://www.importnew.com/18774.html 如何防止单例模式被JAVA反射攻击 http://geek.csdn.net/news/detail/126382 singl...

2016-12-15 15:53:26

阅读数:207

评论数:0

[leetcode]28. Implement strStr()

Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. java代码 p...

2016-12-08 18:11:11

阅读数:167

评论数:0

[leetcode]26. 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 spac...

2016-12-08 17:56:25

阅读数:187

评论数:0

深入理解Java:注解(Annotation)自定义注解入门

转自 http://www.cnblogs.com/peida/archive/2013/04/24/3036689.html 深入理解Java:注解(Annotation)自定义注解入门   要深入学习注解,我们就必须能定义自己的注解,并使用注解,在定义自己的注解之前,我们就...

2016-11-09 22:33:24

阅读数:154

评论数:0

[leetcode]25. 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 of k th...

2016-11-01 18:48:09

阅读数:182

评论数:0

[leetcode]24. Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2-&...

2016-11-01 18:43:27

阅读数:225

评论数:0

[leetcode]23. Merge k Sorted Lists

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Leetcode 21题是合并两个链表。合并K个链表的方法就是2的进一步。有两种方法: 1 ...

2016-11-01 18:38:53

阅读数:102

评论数:0

[leetcode]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 i...

2016-11-01 18:30:32

阅读数:160

评论数:0

[leetcode]21. 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. 直接上代...

2016-10-19 20:39:45

阅读数:141

评论数:0

[leetcode]20. Valid Parentheses

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close i...

2016-10-19 20:22:25

阅读数:253

评论数:0

[leetcode]19. 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, ...

2016-10-19 00:03:11

阅读数:156

评论数:0

[leetcode]18. 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 w...

2016-10-18 23:25:16

阅读数:141

评论数:0

[leetcode]17. 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 (just like on the tel...

2016-10-18 23:20:01

阅读数:179

评论数:0

[leetcode]16. 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...

2016-10-17 22:34:23

阅读数:148

评论数:0

[leetcode]15. 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 ...

2016-10-17 22:19:46

阅读数:159

评论数:0

[leetcode]14. Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings. 比较简单,直接上代码。 java代码 public class Solution { public Strin...

2016-10-15 21:49:09

阅读数:119

评论数:0

[leetcode]13. Roman to Integer

Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 这道题和12题正好相反,但是要比12题难一点。最重要的还是要熟悉对应表...

2016-10-15 18:21:39

阅读数:107

评论数:0

[leetcode]12. Integer to Roman

Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 这道题基本没什么算法上的难点,就是需要知道罗马字母和整数的对应关系就行...

2016-10-15 18:13:54

阅读数:106

评论数:0

[leetcode]11. 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 such that the two ...

2016-10-13 23:21:08

阅读数:149

评论数:0

[leetcode] 9. Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be pali...

2016-10-13 23:07:45

阅读数:155

评论数:0

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