carpenterlee / jcfinternals Goto Github PK
View Code? Open in Web Editor NEW深入理解Java集合框架
License: Other
深入理解Java集合框架
License: Other
以範例那張圖為例
假設remove的是15 也就是index=5的那個元素
在siftDown後那個位置會變成9, heap不對, 因此應該還需要檢查
if (queue[i] == moved) {
siftUp(i, moved);
}
由于官方更推荐使用AarryDeque用作栈和队列,加之上一篇已经讲解过LinkedList,本文将着重讲解ArrayDeque的具体实现。
拼写错误
”WeekHashMap 的这个特点特别适用于需要缓存的场景“ —— 针对博主说的这句话想到的:既然WeekHashMap是弱引用,那么不管内存是否紧张value都有可能会被回收 ; 而软引用,只有当内存不足时才会被回收,那岂不是用软引用更合适,而弱引用在内存泄漏方面更合适一些,博主怎么看?
博主你好,我在我的仓库 2019_campus_apply 中引用了一些本仓库的一些源码分析和部分示例图,无商业用途,开源免费。也欢迎群主能够加入一起交流,QQ 1002039945
Stack Method | Equivalent Deque Method | 说明 |
---|---|---|
push(e) |
addFirst(e) |
向栈顶插入元素,失败则抛出异常 |
无 | offerFirst(e) |
向栈顶插入元素,失败则返回false |
pop() |
removeFirst() |
获取并删除栈顶元素,失败则抛出异常 |
无 | pollFirst() |
获取并删除栈顶元素,失败则返回null |
peek() |
peekFirst() |
获取但不删除栈顶元素,失败则抛出异常 |
无 | peekFirst() |
获取但不删除栈顶元素,失败则返回null |
Stack Method | Equivalent Deque Method | 说明 |
---|---|---|
push(e) |
addFirst(e) |
向栈顶插入元素,失败则抛出异常 |
无 | offerFirst(e) |
向栈顶插入元素,失败则返回false |
pop() |
removeFirst() |
获取并删除栈顶元素,失败则抛出异常 |
无 | pollFirst() |
获取并删除栈顶元素,失败则返回null |
peek() |
getFirst() |
获取但不删除栈顶元素,失败则抛出异常 |
无 | peekFirst() |
获取但不删除栈顶元素,失败则返回null |
PNG图片完全都打不开
add(int index, E element),方法的 解释箭头 有两个下一个。
寻找节点后继
t的右孩子为空,则t的后继是其第一个向左走的祖先。
->
虽然代码是ch == p.right
表述是否应换为"第一个向右走的祖先"?
另外 文中所说的情况1~6 是哪些呢?望答主不吝赐教
易理解
Java8的HashMap做了相当多的优化,当桶上的链表节点大于8的话就转换为红黑树了,测试在hash极不均匀的情况下相比JDK7有明显的性能提升,等待你的分析博客了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.