一、使用场景 Guava Cache是本地缓存,当数据被重复查询多次,愿意耗费一些内存空间来减少查询的操作提高查询的速度,就可以使用Guava Cache。 二、使用方式 1.创建 LoadingCache是附带CacheLoader构建而成的缓存实现。创建自己的CacheLoader通常只需要简单 ...
分类:
其他好文 时间:
2020-03-08 20:22:06
阅读次数:
79
<!DOCTYPE html><html lang="zh-cn"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1. ...
分类:
Web程序 时间:
2020-03-07 21:05:13
阅读次数:
141
Input: [2,3,-2,4] Output: 6 Explanation: [2,3] has the largest product 6. Input: [2,-5,-2,-4,3] Output: 24 Explanation: [-2,-4,3] has the largest prod ...
分类:
其他好文 时间:
2020-03-07 13:08:31
阅读次数:
54
给定一个整数数组 ,找出一个序列中乘积最大的连续子序列(该序列至少包含一个数)。 示例 1: 示例 2: https://leetcode cn.com/problems/maximum product subarray/ 动态规划 其实这道题最直接的方法就是用 DP 来做,而且要用两个 dp 数组 ...
分类:
其他好文 时间:
2020-03-06 13:34:45
阅读次数:
59
A. Inverse
B. Subsequence
C. Convex ...
分类:
其他好文 时间:
2020-03-05 22:28:12
阅读次数:
64
Given a binary tree, find the subtree with maximum average. Return the root of the subtree. Example 1 Input: {1,-5,11,1,2,4,-2} Output:11 Explanation: ...
分类:
其他好文 时间:
2020-03-05 13:42:34
阅读次数:
56
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Input: "babad" Output: ...
分类:
其他好文 时间:
2020-03-05 11:52:43
阅读次数:
60
转自:labuladong公众号 很多读者反应,就算看了前文 动态规划详解,了解了动态规划的套路,也不会写状态转移方程,没有思路,怎么办?本文就借助「最长递增子序列」来讲一种设计动态规划的通用技巧:数学归纳思想。 最长递增子序列(Longest Increasing Subsequence,简写 L ...
分类:
编程语言 时间:
2020-03-05 01:00:26
阅读次数:
71
本文参考以下文章 "Maximum flow" Flow Networks基本性质 在图论中,网络流被定义为一个有向图,其中包含一个起点 S ource和一个终点 T arget,以及几条连接各顶点的边。每条边都有各自的容量 C apacity,这是边所能允许的最大流量 网络流中的流量$f$应满足如 ...
分类:
其他好文 时间:
2020-03-04 23:05:40
阅读次数:
69
1、 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=devic ...