Given a non-empty binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any ...
分类:
其他好文 时间:
2020-05-03 14:27:36
阅读次数:
67
概述 Redis 是一个完全开源免费的、遵守BSD 协议的、内存中的数据结构存储,它既可以作为数据库,也可以作为缓存和消息代理。因其性能优异等优势,目前已被很多企业所使用,但通常在企业中我们会将其作为缓存来使用。Spring Boot 对 Redis也提供了自动配置的支持,接下来本小节将讲解如何在S ...
分类:
编程语言 时间:
2020-05-02 23:05:35
阅读次数:
79
题目 232.用栈实现队列 class MyQueue { private Stack<Integer> in = new Stack<>(); private Stack<Integer> out = new Stack<>(); public void push(int x) { in.push ...
分类:
其他好文 时间:
2020-05-02 22:35:31
阅读次数:
86
Arrays类 Arrays类概述 针对 数组 进行操作的工具类 提供了 排序,查找 等功能 Arrays类常用方法 toString()方法 toString()方法的源码 sort()方法 (七种基本数据类型(除了boolean) + 引用类型) 内部是使用快速排序,默认从小到大。 binary ...
分类:
编程语言 时间:
2020-05-02 21:20:55
阅读次数:
78
相同: 1、LinkedBlockingQueue和ArrayBlockingQueue都实现了BlockingQueue接口; 2、LinkedBlockingQueue和ArrayBlockingQueue都是可阻塞的队列(内部都是使用ReentrantLock和Condition来保证生产和消 ...
分类:
数据库 时间:
2020-05-02 15:06:45
阅读次数:
60
Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list. Input Specification: Each input file contains ...
分类:
其他好文 时间:
2020-05-02 14:56:53
阅读次数:
58
问题: How to find that a number is float or integer ? 如何找到数字为float或integer ? 1.25 --> float 1 --> integer 0 --> integer 0.25 --> float 解决方案: 参考一: https: ...
分类:
其他好文 时间:
2020-05-02 09:19:00
阅读次数:
56
== 和 equals异同 ==比较即比较内容也比较地址是否相同; equals方法,比较两个对象内容是否相同 注意: (1)字符串比较,不允许用== ,只能通过equals方法 (2)如果Integer和Integer/int比较具体是否相等,此时绝对不允许使用== (3)注意:数字,和字符串比较 ...
分类:
其他好文 时间:
2020-05-02 00:25:23
阅读次数:
65
MySQL中定义数据字段的类型对你数据库的优化是非常重要的。 MySQL支持多种类型,大致可以分为三类:数值、日期/时间和字符串(字符)类型。 数值类型 类型大小范围(有符号)范围(无符号)用途 TINYINT 1 byte (-128,127) (0,255) 小整数值 SMALLINT 2 by ...
分类:
数据库 时间:
2020-05-01 17:02:33
阅读次数:
100
Json-Lib、Org.Json、Jackson、Gson、FastJson五种方式转换json类型 只列举了最省事的方式。不涉及复制情况和速度。 测试用例,一个User类,属性name,age,location。重写toString()。 public class User { private ...
分类:
Web程序 时间:
2020-05-01 16:39:37
阅读次数:
61