myshuangwaiwai

随笔分类 -  Java

Java源码分析系列
摘要:1)深入Java集合学习系列:HashMap的实现原理2)深入Java集合学习系列:LinkedHashMap的实现原理3)深入Java集合学习系列:HashSet的实现原理4)深入Java集合学习系列:LinkedHashSet的实现原理5)深入Java集合学习系列:ArrayList的实现原理 阅读全文

posted @ 2015-08-16 22:30 myshuangwaiwai 阅读(133) 评论(0) 推荐(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. 1 publi... 阅读全文

posted @ 2015-07-29 17:35 myshuangwaiwai 阅读(132) 评论(0) 推荐(0)

LeetCode 20 -- Valid Parentheses
摘要:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the c... 阅读全文

posted @ 2015-07-29 17:04 myshuangwaiwai 阅读(135) 评论(0) 推荐(0)

LeetCode 15 -- 3Sum
摘要: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.... 阅读全文

posted @ 2015-07-29 15:28 myshuangwaiwai 阅读(170) 评论(0) 推荐(0)

LeetCode 11 -- Container With Most Water
摘要:Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ... 阅读全文

posted @ 2015-07-28 17:10 myshuangwaiwai 阅读(154) 评论(0) 推荐(0)

LeetCode 7 -- String to Integer (atoi)
摘要:Implementatoito convert a string to an integer.转换很简单,唯一的难点在于需要开率各种输入情况,例如空字符串,含有空格,字母等等。另外需在写的时候注意细节问题,完成后需要反复调试,整合。 1 public class Solution { 2 p... 阅读全文

posted @ 2015-05-18 17:07 myshuangwaiwai 阅读(132) 评论(0) 推荐(0)

LeetCode 6 -- ZigZag Conversion
摘要:The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo... 阅读全文

posted @ 2015-05-06 19:59 myshuangwaiwai 阅读(135) 评论(0) 推荐(0)

LeetCode 5 -- Longest Palindromic Substring
摘要:Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文

posted @ 2015-05-05 22:06 myshuangwaiwai 阅读(156) 评论(0) 推荐(0)

LeetCode 4 -- Median of Two Sorted Arrays
摘要:There are two sorted arraysnums1andnums2of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should... 阅读全文

posted @ 2015-05-01 16:04 myshuangwaiwai 阅读(121) 评论(0) 推荐(0)

LeetCode 3 -- Longest Substring Without Repeating Characters
摘要:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文

posted @ 2015-04-30 14:33 myshuangwaiwai 阅读(131) 评论(0) 推荐(0)

Java技术文章收藏
只有注册用户登录后才能阅读该文。

posted @ 2015-04-27 19:48 myshuangwaiwai 阅读(22) 评论(0) 推荐(0)

Java实现字符串反转的8种方法
摘要:1 /** 2 * 3 */ 4 package com.wsheng.aggregator.algorithm.string; 5 6 import java.util.Stack; 7 8 /** 9 * 8 种字符串反转的方法, 其实可以是9种方法,第9种是... 阅读全文

posted @ 2015-04-27 16:45 myshuangwaiwai 阅读(1014) 评论(0) 推荐(0)

LeetCode 2 -- 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 single ... 阅读全文

posted @ 2015-04-26 21:29 myshuangwaiwai 阅读(125) 评论(0) 推荐(0)

LeetCode 1 -- 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 nu... 阅读全文

posted @ 2015-04-21 11:37 myshuangwaiwai 阅读(118) 评论(0) 推荐(0)

LeetCode189——Rotate Array
摘要:Rotate an array ofnelements to the right byksteps.For example, withn= 7 andk= 3, the array[1,2,3,4,5,6,7]is rotated to[5,6,7,1,2,3,4].Note:Try to come... 阅读全文

posted @ 2015-04-16 15:28 myshuangwaiwai 阅读(84) 评论(0) 推荐(0)