题目: 反转链表 II:反转从位置 m 到 n 的链表。请使用一趟扫描完成反转。 反转从位置 m 到 n 的链表。请使用一趟扫描完成反转。 说明:1 ≤ m ≤ n ≤ 链表长度。 示例:输入: 1->2->3->4->5->NULL, m = 2, n = 4输出: 1->4->3->2->5-> ...
分类:
编程语言 时间:
2020-05-02 22:56:54
阅读次数:
130
题目 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
In a sequence of numbers,we can find some number pairs that conform to the rule below: Assuming that there exist two numbers,N and M and it's position ...
分类:
其他好文 时间:
2020-05-02 18:46:09
阅读次数:
60
相同: 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