05 2015 档案

JAVA 对象分配过程
摘要:1. 在JAVA中,对象的分配一般使用new关键字。 当虚拟机遇到new指令时,会先检查该指令所包含的参数在常量池中能否找到一个符号引用,并检查该符号引用所代表的类是否被加载、解析和初始化。 如果没有,则会先执行类的加载过程。2. 类加载完成后,会为该对象分配内存空间。一个对象需要多大的内存空间在... 阅读全文

posted @ 2015-05-25 14:55 linxiong1991 阅读(3174) 评论(0) 推荐(0)

leetcode 212-Word Search II
摘要:Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of sequentially adjac... 阅读全文

posted @ 2015-05-20 21:03 linxiong1991 阅读(204) 评论(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-19 17:34 linxiong1991 阅读(348) 评论(0) 推荐(0)

LeetCode-Maximum Gap
摘要:Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 ... 阅读全文

posted @ 2015-05-13 11:39 linxiong1991 阅读(263) 评论(0) 推荐(0)

LeetCode-Longest Consecutive Sequence
摘要:Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ... 阅读全文

posted @ 2015-05-12 22:59 linxiong1991 阅读(108) 评论(0) 推荐(0)

LeetCode-Recover Binary Search Tree
摘要:Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ... 阅读全文

posted @ 2015-05-12 22:00 linxiong1991 阅读(110) 评论(0) 推荐(0)

LeetCode-Jump Game II
摘要:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... 阅读全文

posted @ 2015-05-12 10:57 linxiong1991 阅读(123) 评论(0) 推荐(0)

LeetCode-60 Permutation Sequence
摘要:The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie... 阅读全文

posted @ 2015-05-10 16:46 linxiong1991 阅读(682) 评论(0) 推荐(0)

LeetCode-79 Word Search
摘要:Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjace... 阅读全文

posted @ 2015-05-09 00:19 linxiong1991 阅读(1339) 评论(0) 推荐(0)

LeetCode-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-descending ord... 阅读全文

posted @ 2015-05-07 19:47 linxiong1991 阅读(123) 评论(0) 推荐(0)

二叉树的遍历(非递归)
摘要:1. 先序遍历public void preorder(TreeNode root) { if(root == null) return; Stack stack = new Stack(); while(true) { if(root... 阅读全文

posted @ 2015-05-05 17:37 linxiong1991 阅读(168) 评论(0) 推荐(0)

导航