摘要: import java.util.Stack; /** * @Author: * @Date: 2018/9/28 11:36 */ public class TreeSort { public static void main(String[] args) { TreeNode level4_1 = new TreeNode(8,null,null); ... 阅读全文
posted @ 2018-09-28 21:51 使用D 阅读(200) 评论(0) 推荐(0) 编辑
摘要: ArrayBlockingQueue 基于同一个ReentrantLock锁实现线程安全,同时记录takeIndex与putIndex两个索引用于拿取和增加队列索引 使用集合实现的有界队列,一旦创建ArrayBlockingQueue对象,容量就固定了,对于排队等待的生产者或者消费者线程ArrayB 阅读全文
posted @ 2018-09-28 11:29 使用D 阅读(246) 评论(0) 推荐(0) 编辑
摘要: ArrayList 线程:不安全 实现方式:数组 初始大小:10 扩容:(原数组容量+原数组容量/2),如果(原数组容量+原数组容量/2)<传入的minCapacity,则扩容到minCapacity 数组最大值:Integer.MAX_VALUE - 8,由于有一些vms会在数组头存储一些字,为了 阅读全文
posted @ 2018-09-28 11:28 使用D 阅读(895) 评论(0) 推荐(0) 编辑