- 博客(20)
- 资源 (1)
- 收藏
- 关注
转载 Java虚拟机学习 - 体系结构 内存模型
一:Java技术体系模块图二:JVM内存区域模型1.方法区也称"永久代” 、“非堆”, 它用于存储虚拟机加载的类信息、常量、静态变量、是各个线程共享的内存区域。默认最小值为16MB,最大值为64MB,可以通过-XX:PermSize 和 -XX:MaxPermSize 参数限制方法区的大小。
2014-08-30 18:39:51 632
原创 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 valid parentheses substring is "()",
2014-08-30 15:51:25 656
转载 JUC (Java Util Concurrency) 基础内容概述
目录[-]转自:http://www.goldendoc.org/2011/05/juc/1. JUC概况2. 原子操作3. 指令重排4. Happens-before法则:(Java 内存模型)JMM的特性:volatile语义:5. CAS操作6. Lock 锁7. AQSAQS实现:Atomically managing synchro
2014-08-25 22:21:42 28025
原创 垃圾收集器简介
HotSpot JVM收集器 上面有7中收集器,分为两块,上面为新生代收集器,下面是老年代收集器。如果两个收集器之间存在连线,就说明它们可以搭配使用。Serial(串行GC)收集器Serial收集器是一个新生代收集器,单线程执行,使用复制算法。它在进行垃圾收集时,必须暂停其他所有的工作线程(用户线程)。是Jvm client模式下默认的新生
2014-08-25 09:42:23 5663
转载 Java 程序里的内存泄漏
译序:Java 的内存泄漏,这不是一个新话题。Jim Patrick 的这篇文章早在 2001 年就写出来了。但这并不意味着 Java 的内存泄漏是一个过时了的甚至不重要的话题。相反,Java 的内存泄漏应当是每一个关心程序健壮性、稳定性和高性能的程序员所必须了解的知识。本文将揭示什么时候需要关注内存泄漏以及如何进行防止。摘要:Java 程序里也存在内存泄漏?当然。和流行的看法相反,内
2014-08-23 11:08:46 590
原创 Substring with Concatenation of All Words
原题:You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and w
2014-08-22 14:51:24 1379
原创 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 for "abcabcbb" is "abc", which the length is
2014-08-22 10:16:34 619
原创 Divide Two Integers
Divide two integers without using multiplication, division and mod operator.解答:public int divide(int dividend, int divisor) { boolean negative = (dividend0) || (dividend>0 && divisor<0);
2014-08-20 19:02:56 521
原创 Remove Element
原题:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new len
2014-08-20 16:15:04 390
原创 Remove Duplicates from Sorted Array II
原题:Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array A = [1,1,1,2,2,3],Your function should return length = 5, and A is no
2014-08-19 16:13:53 408
原创 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 space for another array, you must do this in p
2014-08-19 14:58:23 524
原创 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 then left-out nodes in the end should remain
2014-08-18 21:24:22 464
原创 Swap Nodes in Pairs
原题:For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You may not modify the values in the list, only nodes itself can be
2014-08-17 22:22:28 412
原创 Merge k Sorted Lists
原题:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.此题可以递归的两两归并,也可以使用youxianj
2014-08-15 22:29:40 584
原创 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 is:"((()))", "(()())", "(())()", "()(()
2014-08-15 20:03:22 449
原创 Valid Parentheses
原题:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are
2014-08-12 19:26:11 430
原创 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, and n = 2. After removing the second node from the
2014-08-11 20:31:41 448
原创 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 telephone buttons) is given below.Input
2014-08-11 17:03:27 9722 2
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人