由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - underlying sort algorithm for SET in STL?
相关主题
关于在rotated sorted array中查找的问题C++11和clang的很多新特性本质就是纵容新手酒驾
How to see the content of a library file为啥允许这样的const设计
C++ string类输入数据的问题Listing files under a directory in C++
what's wrong with this C++ code?why int** cannot convert to const int** ?
C++: define a reference always reference the same objectC的问题,高手请指点
typedef为什么需要定义 = 和 copy ctor
a question about CASTHow to change a string under gdb prompt
C++: How to read until the end of file?a question regarding....
相关话题的讨论汇总
话题: set话题: stl话题: algorithm话题: sort话题: underlying
进入Programming版参与讨论
1 (共1页)
a********r
发帖数: 58
1
What's the underlying sort algorithm for SET in C++ STL? Thanks!
t****t
发帖数: 6806
2
usually sort() is based on quicksort. however it's implementation defined,
given the complexity requirement is satisfied.

【在 a********r 的大作中提到】
: What's the underlying sort algorithm for SET in C++ STL? Thanks!
t******r
发帖数: 88
3
恩,对方都问了是SET,就是红黑树,那应该不是quicksort了,SET本来就是有序的吧

【在 t****t 的大作中提到】
: usually sort() is based on quicksort. however it's implementation defined,
: given the complexity requirement is satisfied.

l******e
发帖数: 12192
4
你是对的

【在 t******r 的大作中提到】
: 恩,对方都问了是SET,就是红黑树,那应该不是quicksort了,SET本来就是有序的吧
t****t
发帖数: 6806
5
哦, 对不起没看见是set.

【在 t******r 的大作中提到】
: 恩,对方都问了是SET,就是红黑树,那应该不是quicksort了,SET本来就是有序的吧
a********r
发帖数: 58
6
but what's the built-in sorting algorithm for the sorted set if have? thanks
!
t****t
发帖数: 6806
7
someone already told you it's red-black tree. it's always sorted.

thanks

【在 a********r 的大作中提到】
: but what's the built-in sorting algorithm for the sorted set if have? thanks
: !

a********r
发帖数: 58
8
but what's the built-in sorting algorithm for the sorted set if have? thanks
!
x*******u
发帖数: 2074
9
没有set::sort()这个函数的
插入/删除等modifier操作都必须保证整个tree是binary search tree

thanks

【在 a********r 的大作中提到】
: but what's the built-in sorting algorithm for the sorted set if have? thanks
: !

h*******u
发帖数: 15326
10
set里面值修改后不能自动sort,怎么回事。
如果是插入或删除则能保证自动排序

【在 t****t 的大作中提到】
: someone already told you it's red-black tree. it's always sorted.
:
: thanks

t****t
发帖数: 6806
11
本来就不能修改. 必须删掉重新加.

【在 h*******u 的大作中提到】
: set里面值修改后不能自动sort,怎么回事。
: 如果是插入或删除则能保证自动排序

h*******u
发帖数: 15326
12
看来我没用错,不过这个设计。。。呵呵

【在 t****t 的大作中提到】
: 本来就不能修改. 必须删掉重新加.
t****t
发帖数: 6806
13
这个设计没什么问题啊, 红黑树里的元素要移动本来也是要删掉再重新加的.

【在 h*******u 的大作中提到】
: 看来我没用错,不过这个设计。。。呵呵
h*******u
发帖数: 15326
14
算法上没错,不过用起来有点不方便了
可能是习惯问题

【在 t****t 的大作中提到】
: 这个设计没什么问题啊, 红黑树里的元素要移动本来也是要删掉再重新加的.
1 (共1页)
进入Programming版参与讨论
相关主题
a question regarding....C++: define a reference always reference the same object
Excel VBA protection.typedef
Do the two statements cost the same amount of time?a question about CAST
c或者c++中变量保存在什么地方怎么看呢?C++: How to read until the end of file?
关于在rotated sorted array中查找的问题C++11和clang的很多新特性本质就是纵容新手酒驾
How to see the content of a library file为啥允许这样的const设计
C++ string类输入数据的问题Listing files under a directory in C++
what's wrong with this C++ code?why int** cannot convert to const int** ?
相关话题的讨论汇总
话题: set话题: stl话题: algorithm话题: sort话题: underlying