热门
最新
红包
立Flag
投票
同城
我的
发布
c++ 中 unordered_set 类似 python 里的set
使用hash表存储数据,插入和查询都是O(1),支持的数据类型也有限,不支持vector, 其他的,比如说string是支持的
unordered_map 类似字典
其实c++本来有set,但那个是ordered set,采用平衡检索二叉树:红黑树,也成为RB树(Red-Black Tree),查询是logN
unordered_set 基础
https://blog.csdn.net/qq_39450326/article/details/75949511
https://blog.csdn.net/fanyun_01/article/details/81275676
unordered_map基础
http://c.biancheng.net/view/7231.html
unordered_map案例
https://blog.csdn.net/yz930618/article/details/88850284
hash vector的解法
https://blog.csdn.net/dreamiond/article/details/88553332
CSDN App 扫码分享
评论
点赞
打赏
- 复制链接
- 举报
下一条:
c++ 中 unordered_set 类似 python 里的set使用hash表存储数据,插入和查询都是O(1),支持的数据类型也有限,不支持vector, 其他的,比如说string是支持的 unordered_map 类似字典其实c++本来有set,但那个是ordered set,采用平衡检索二叉树:红黑树,也成为RB树(Red-Black Tree),查询是logNunordered_set 基础https://blog.csdn.net/qq_39450326/article/details/75949511https://blog.csdn.net/fanyun_01/article/details/81275676http://c.biancheng.net/view/7231.htmlunordered_map案例https://blog.csdn.net/yz930618/article/details/88850284hash vector的解法https://blog.csdn.net/dreamiond/article/details/88553332