09 2018 档案
摘要:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai
阅读全文
摘要:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
阅读全文
摘要:Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Example 1: Example 2:
阅读全文
摘要:You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl
阅读全文
摘要:3.1 概述 程序计数器,虚拟机栈,本地方法3个区域随线程而生,随线程而灭;栈中的Stack Frame随着方法进入和退出有条不紊地进行着出栈入栈操作。每个Stack Frame中分配多少内存基本上是在类结构确定下来时已知的,因此这几个区域的内存分配和回收都具备确定性,在这几个区域内就不需要过多考虑
阅读全文
摘要:二叉树的定义不多赘述,先贴上二叉树的代码 前序遍历 递归实现: 非递归实现: 中序遍历 递归实现: 非递归实现: 后序遍历 递归实现: 非递归实现: 注:不论是递归还是非递归方法,遍历整棵树的时间复杂度都是O(N),额外的空间复杂度都是O(L),N为二叉树的节点数,L为二叉树的层数。
阅读全文
摘要:快速排序的核心实现是,取一个基准数,使得数的左边小于它,数的右边大于它。 然后再对两边进行相同的递归操作。
阅读全文
摘要:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Example 2: 使用boolean创建一
阅读全文
摘要:Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Foll
阅读全文
摘要:2.1 串行、并发与并行 串行:ABC 并发:A B C 并行:A B C 2.2 竞态 2.2.1 竞态是指计算的正确性依赖于时间顺序或者线程的交错。 竞态往往伴随着Dirty Read问题,即线程读取到一个过时的数据,Lost Update问题,即一个线程对数据所做的更新没有体现在后续对其他数据
阅读全文
摘要:1.1.1 线程的创建,启动和运行 在Java平台中创建一个线程就是创建一个Thread类(或其子类)的实例。 运行一个线程实际上就是让Java虚拟机执行该线程的run方法,从而使相应线程的业务逻辑处理代码得到执行。为此,我们先要启动线程,使用Thread类的start方法即可。启动一个线程的实质是
阅读全文
摘要:2.1运行时数据区 java虚拟机在执行java程序的过程中会把它管理的内存划分为若干个不同的数据区域,它们有各自的用途,以及创建和销毁的时间。 java虚拟机运行时数据区 2.1.1 程序计数器 程序计数器是一块较小的内存空间,它可以看成是当前线程所执行字节码的行号指示器。 由于java虚拟机的多
阅读全文

浙公网安备 33010602011771号