- 博客(6)
- 资源 (4)
- 收藏
- 关注
原创 Java内存模型与垃圾收集
运行时数据区域: 线程私有: 1.程序计数器 如果正在执行的方法为Native方法,程序计数器值为空。 2.java虚拟机栈 虚拟机栈描述java方法执行的内存模型:每个方法被执行时会同时创建一个栈帧用于存储局部变量表、操作栈、动态链接、方法出口。从方法的调
2015-03-09 16:12:45 478
原创 [leetcode] Evaluate the value of reverse polish expression
/*Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "
2014-10-02 23:10:43 505
原创 Reverse word in a string [leetcode]
/*Reverse Words in a String Total Accepted: 35825 Total Submissions: 256704 My SubmissionsGiven an input string, reverse the string word by word.For example,Given s = "the sky is blue",r
2014-10-02 17:55:47 479
原创 Maximum Product Subarray [leetcode]
/* Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the larges
2014-10-02 14:33:13 479
原创 卡塔兰数求解BST数目
首先,是在leetcode上遇到的一道求n个自然数可以组成的BST数目。很自然的两种想法:1. 模拟数的生成,时间复杂度会很高,编程困难2.找出树生成数目的生成规律,直接按公式求解然后,关于 卡塔兰数是什么,可以参见维基百科 http://zh.wikipedia.org/wiki/%E5%8D%A1%E5%A1%94%E5%85%B0%E6%95%B0
2014-09-24 14:00:30 696
转载 已知二叉树的中序和前序序列(或后序)求解树
转载自:http://www.cnblogs.com/bmrs/archive/2010/08/19/SloveTree.html这种题一般有二种形式,共同点是都已知中序序列。如果没有中序序列,是无法唯一确定一棵树的,证明略。一、已知二叉树的前序序列和中序序列,求解树。1、确定树的根节点。树根是当前树中所有元素在前序遍历中最先出现的元素。2、
2014-02-18 15:06:59 642
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人