jdk - Java 中什么样的数据类型,插入和查询都很快的。
天蓬老师
天蓬老师 2017-04-17 15:25:12
0
3
347

今天面试被问到这个问题,没有了解过。貌似说什么环式结构的。
原问是这样的:“Java 中什么样的数据类型,在前后端插入速度快,并且查询速度也很快。”

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
大家讲道理

The data structure of double linked list + hash table. The nodes of the linked list serve as the keys of the hash table. For a doubly linked list, we can maintain the head pointer and tail pointer to achieve head and tail insertion O(1), and the hash table can achieve query O(1). This data structure is very commonly used, see leetcode’s classic question LRU

Peter_Zhu

arraylist set get快 linkedlist add remove 快

黄舟

"Backend" obviously refers to the linked list, the query speed is fast, it seems to be talking about LinkedHashMap.

LinkedHashMap is a double linked list + hash table structure.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!