map在insert数据后红黑树结构变化
来源:互联网 发布:手机淘宝上怎么开店铺 编辑:程序博客网 时间:2024/05/18 20:11
下面这段测试代码
std::map<int, int> tmpMap;
pair <std::map<int, int>::iterator, bool> tmp = tmpMap.insert(make_pair(1, 11));tmp = tmpMap.insert(make_pair(2, 12));
tmp = tmpMap.insert(make_pair(3, 13));
tmp = tmpMap.insert(make_pair(4, 14));
tmp = tmpMap.insert(make_pair(5, 15));
tmp = tmpMap.insert(make_pair(6, 16));
tmp = tmpMap.insert(make_pair(7, 17));
执行的时候map底层红黑树结构如下图:
1、pair <std::map<int, int>::iterator, bool> tmp = tmpMap.insert(make_pair(1, 11));
2、tmp = tmpMap.insert(make_pair(2, 12));
3、tmp = tmpMap.insert(make_pair(3, 13));
4、tmp = tmpMap.insert(make_pair(4, 14));
5、tmp = tmpMap.insert(make_pair(5, 15));
6、tmp = tmpMap.insert(make_pair(6, 16));
7、tmp = tmpMap.insert(make_pair(7, 17));
参考:
1、http://blog.csdn.net/mxway/article/details/29216199
2、http://www.bubuko.com/infodetail-172926.html
0 0
- map在insert数据后红黑树结构变化
- 收集Insert/Update/Delete操作所引起的数据变化
- map::insert
- mybatis 在mysql上数据不能insert
- 根据基本表结构及其数据生成INSERT...的SQL
- 根据基本表结构及其数据生成 INSERT ... 的 SQL
- map容器插入数据之 map[] 和 insert 方式的分析
- 如何在MAP中使用结构体
- map::insert and map::find
- FMDB中读取原数据,然后insert更改数据,保存后再读取时数据变化了。
- map insert使用
- std::map find insert
- map::insert的使用
- map insert执行崩溃
- map insert 操作
- c++ map insert error
- map,set----insert
- map的insert操作
- MFC控件大小及控件字体跟随对话框的改变而改变
- iOS集成支付宝
- android support v4包
- 总结使用Unity 3D优化游戏运行性能的经验
- 科比:一位个人英雄主义者的"意外死亡"
- map在insert数据后红黑树结构变化
- Android源码问题解答之三(状态栏和锁屏)
- 我的学习之旅(33) sched.h
- 奋斗需要战友
- coco2d-x 下载网络图片
- 菜鸟学JS(四)——javascript为按钮注册回车事件(设置默认按钮)
- iOS开发之UIWebView
- asp.net实现自动logout
- 大小不固定的图片和多行文字的垂直水平居中