What's the difference between hashtable and maps?
来源:互联网 发布:pat端口地址转换 编辑:程序博客网 时间:2024/05/22 14:23
From the point of view of the syntax and how you use them, there is little difference. The main difference is that the entries in a std::map and std::multimap are always sorted while they are not in hash tables.
The main difference otherwise is a difference in the speed at which you can access individual elements. Maps are usually stored as binary trees and hash maps are stored as hash tables. This means that if you have N elements in your container, then accessing an element in a map requires O(log(N)) time and the same operation in a hash map is O(1). So hash maps are faster, in general than maps.
0 0
- What's the difference between hashtable and maps?
- What's the difference between Dictionary, Hashtable & Hashset?
- What's the difference between an event and a delegate?
- what's the difference between OnDraw and OnPaint
- What's the difference between stack and heap?
- What's the difference between LastWriteTime and ChangeTime in FILE_BASIC_INFO?
- What's the difference between Heap and Stack
- What's the difference between overload and override
- What's the difference between glibc and libc6?
- What's the difference between "but" and "yet"
- What's+the+difference+between+virtualization+and+cloud+computing?
- What's the difference between parallel and concurrent?
- What's the difference between program arguments and VM arguments?
- What's the difference between Template and Table in Smartforms
- What's the difference between “local” and “my” in Perl
- what's the difference between int (* f [])(); and int f[]();
- What's the difference between gcc and g++/gcc-c++?
- What's the difference between headsets and headphones?
- 上传多图发布 微信小程序
- 最短路简单模板 ---- Til the Cows Come Home 【dijk()】
- LeetCode 9 Polindrome Number
- log4net 2.0.8不能将log txt作为日志的扩展名的原因
- VS2015 修改模板,增加类文件的头注释
- What's the difference between hashtable and maps?
- Py4j原理及简单使用
- poj2124:K-th Number
- Spark (Python版) 学习笔记(二)
- c++实验3 项目1
- 在DB中实现软件的配置功能的建议方案
- FTL常用标签及语法
- Android与JS的交互汇总
- Android设计模式(十三)-迭代器模式