2015年3月11日

LeetCode-154 Find Minimum in Rotated Sorted Array II

摘要: Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a sort... 阅读全文

posted @ 2015-03-11 18:29 linxiong1991 阅读(124) 评论(0) 推荐(0)

2015年3月10日

java 垃圾回收机制

摘要: 1. 哪些区域的内存需要回收。 Java运行时内存区域:程序计数器,虚拟机栈,本地方法栈,堆,方法区。前三者是线程私有的,堆和方法区是线程共享的。 其中,程序计数器、虚拟机栈和本地方法栈随着线程的创建而分配,随着线程的死亡回收。栈中栈帧分配的内存大小基本在类结构确定时就已知。这几个区域的内存分配... 阅读全文

posted @ 2015-03-10 21:36 linxiong1991 阅读(152) 评论(0) 推荐(0)

2015年3月9日

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-03-09 21:15 linxiong1991 阅读(106) 评论(0) 推荐(0)

LeetCode-108 Convert Sorted Array to Binary Search Tree

摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.知识点:二叉搜素树: 1. 如果root有左子节点,则所有左边的节点root; 3. root.lef... 阅读全文

posted @ 2015-03-09 20:08 linxiong1991 阅读(94) 评论(0) 推荐(0)

2015年3月8日

LeetCode-137 Single Number II

摘要: Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp... 阅读全文

posted @ 2015-03-08 23:49 linxiong1991 阅读(126) 评论(0) 推荐(0)

2015年3月3日

LeetCode-32 Longest Valid Parentheses

摘要: Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest... 阅读全文

posted @ 2015-03-03 20:13 linxiong1991 阅读(163) 评论(0) 推荐(0)

2015年3月2日

LeetCode-56 Merge Intervals

摘要: Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18].Hide TagsArray... 阅读全文

posted @ 2015-03-02 17:35 linxiong1991 阅读(100) 评论(0) 推荐(0)

2015年2月25日

LeetCode-138 Copy List with Random Pointer

摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ... 阅读全文

posted @ 2015-02-25 18:32 linxiong1991 阅读(357) 评论(0) 推荐(0)

LeetCode-31 Next Permutation

摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl... 阅读全文

posted @ 2015-02-25 11:22 linxiong1991 阅读(116) 评论(0) 推荐(0)

2015年2月24日

LeetCode-47 Permutations II

摘要: Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the following unique perm... 阅读全文

posted @ 2015-02-24 01:12 linxiong1991 阅读(97) 评论(0) 推荐(0)

导航