歼灭是什么意思| 什么减肥最快不反弹| 什么是拉拉| 血钾是什么意思| 脸上皮肤痒是什么原因| 孕晚期感冒可以吃什么药| 三重一大是什么内容| 割包皮看什么科| 和硕是什么意思| 什么东西放进去是硬的拿出来是软的| 经常手淫会有什么危害| 文心什么字| 借刀杀人是什么生肖| 大饼是什么意思| 肠易激综合征吃什么药| 晚上口苦是什么原因引起的| 肾虚什么症状| 属猪和什么属相最配| 男大三后面一句是什么| b超和阴超有什么区别| 皮肤发痒是什么原因| 什么是高血压| 中国铁塔是干什么的| 什么验孕棒准确率高| 疗愈是什么意思| 盐酸西替利嗪片主治什么| 右下腹疼痛什么原因| 大利月小利月什么意思| 来姨妈吃什么水果好| 割包皮是什么| 月经推迟一个月不来什么原因| 休克疗法是什么意思| 跨境电子商务是什么| essence什么意思| 清油是什么油| 来月经前头痛什么原因| 查电话号码打什么电话| wonderland是什么意思| 孩子腿疼是什么原因| 肛门瘙痒是什么病| iod什么意思| kappa是什么意思| 红黑相间的蛇是什么蛇| 七月22号是什么星座| 红隼吃什么| 什么是比特币| 水印是什么意思| hpv是检查什么的| 最难写的字是什么| 地中海贫血有什么症状| 小麦粉可以做什么吃的| 西兰花炒什么好吃| 太妃糖为什么叫太妃糖| 淋巴细胞百分比偏低是什么原因| 益母草颗粒什么时候喝| 腺瘤是什么意思| 牙龈长泡是什么原因| 装腔作势是什么意思| 稀释是什么意思| 性欲是什么意思| 男人阳虚吃什么药最好| 什么最重要| 胃间质瘤为什么不建议切除| 喝啤酒头疼是什么原因| 蝉又叫什么名字| 女人长期喝西洋参有什么好处| 突然恶心想吐是什么原因| 控制血糖吃什么食物| 早射吃什么药| 胆气不足吃什么中成药| 氧化铜什么颜色| 伤口流水是什么原因| 为什么佛山有三个车牌| 鸡的祖先是什么动物| vivo是什么牌子| 背痒是什么原因| 做梦掉粪坑什么征兆| 胸膜炎是什么症状| 鱼露是什么| dsd是什么意思| 隔离霜和粉底液有什么区别| 洗发水和洗发露有什么区别| 厨子什么意思| 8月3号是什么星座| 白细胞酯酶弱阳性什么意思| 股骨头坏死什么原因| 农历10月19日是什么星座| 召力念什么| 非特异性阴道炎是什么意思| 无机磷测定是检查什么| p和t分别是什么意思| 肝郁脾虚吃什么中成药| 躺枪是什么意思| 硬膜囊前缘受压是什么意思| 大连有什么好吃的| 什么烟好抽| 益生菌和益生元有什么区别| 老头疼是什么原因导致的| 治疗狐臭最好的方法是什么| 摩羯是什么星座| 女人吃枸杞有什么好处| 红楼梦又名什么| 什么是肺腺癌| 怀孕初期会有什么症状| 脚痛什么原因引起的| 甲胎蛋白是检查什么| 乳腺回声不均匀是什么意思| NPY什么意思| 阴囊潮湿吃什么药| 早上手肿胀是什么原因| 小孩病毒感染吃什么药| 蒲公英和什么搭配最好| 女性排卵期出血是什么原因| molly是什么意思| 二级以上医院是什么意思| 下肢动脉硬化吃什么药| 吃什么对头发有好处| 双侧卵巢多囊样改变是什么意思| 宋徽宗叫什么| 湿气太重了吃什么药| 圣经是什么| 烧烤用什么油| 锐字五行属什么| 五月一日是什么星座| 什么是粗粮食物有哪些| 狗为什么不死在家里| 肝病不能吃什么| 一吃东西就肚子疼是什么原因| 马齿苋能治什么病| 血糖高适合喝什么汤| 什么叫细胞| 整装待发是什么意思| 10月17日什么星座| 血糖高的人适合吃什么水果| 喉咙肿瘤有什么症状| 卡路里是什么意思| 什么颜色加什么颜色等于蓝色| 打耳洞不能吃什么| 淋雨了喝什么驱寒| 健胃消食片什么时候吃最好| 一什么鸟窝| 新生儿甲状腺偏高有什么影响| 还替身是什么意思| 移植后吃什么水果好| 坐飞机需要什么证件| 强的松又叫什么名字| 胃疼发烧是什么原因| 左脸颊有痣代表什么| 人在什么情况下会发烧| 出水痘吃什么药| 温度计代表什么生肖| 小孩便秘吃什么通便快| 台风什么时候结束| 家属是什么意思| 拔牙后吃什么消炎药| 以身相许是什么意思| 不变应万变是什么意思| 胃难受吃什么食物好| 如夫人是什么意思| 智商120是什么水平| 假象是什么意思| 脂蛋白高是什么意思| 绝倒是什么意思| 什么东西不能吃| 吉士粉是什么东西| 吃东西感觉口苦是什么原因| 电视剧上星是什么意思| 红枣为什么要炒黑再泡水喝| ivd是什么意思| 时来运转是什么意思| 尿蛋白高不能吃什么食物| 脾虚湿气重吃什么| 恍惚什么意思| 小便尿血是什么原因| 鹦鹉吃什么食物| 6月份是什么季节| 六味地黄丸治什么| 思量是什么意思| 相机hdr功能是什么意思| 可孚属于什么档次| 嗓子疼咽口水都疼吃什么药| 候场是什么意思| rpr是什么检查项目| 艾灰有什么作用和功效| 180度是什么角| 吃茶油对身体有什么好处| 诺帝卡是什么档次| 核酸是什么| 命运是什么意思| 便秘应该挂什么科室| 珊瑚是什么| 7月6日是什么节日| 2010年属什么生肖| 中产家庭的标准是什么| 早些泄挂什么科| 艺伎什么意思| 什么相关四字成语| 瘦脸针的危害有什么副作用| 开光的手串有什么禁忌| 奶粉结块是什么原因| 嘴苦口臭是什么原因造成的| 晚上3点是什么时辰| 慢性阑尾炎吃什么药| 甲沟炎是什么样子的| urea是什么意思| nothomme什么牌子| 无以言表什么意思| ccu病房是什么意思| 儿童说话晚去医院挂什么科| 梦见老板是什么意思| 角化异常性疾病是什么| 血糖的单位是什么| 埋线是什么意思| 躁动是什么意思| 前列腺彩超能查出什么| 脾喜欢什么食物| ch发什么音| 轴位什么意思| 九七年属什么| 拔牙后需要注意什么| 婴儿补铁吃什么铁剂| 来月经量少吃什么可以增加月经量| 姐姐的女儿应该叫什么| 四个口是什么字| 财评是什么意思| 与狼共舞什么意思| 肝气虚吃什么中成药| 什么宽带网速快又便宜| 育婴师是干什么的| 邹去掉耳朵旁读什么| 科目一考试需要带什么| 57属什么生肖| pg在医学是什么意思| 一直咳嗽是什么原因| 公仆是什么意思| 588是什么意思| 1.13是什么星座| 忧思是什么意思| 疤痕增生是什么| 元朝是什么民族| pigeon是什么牌子| 木耳和什么不能一起吃| 梦见已故的父母是什么兆头| 常吃阿司匹林有什么副作用| 胶原蛋白有什么作用| 愣头青是什么意思| 嗓子哑是什么原因引起的| 什么叫修辞手法| 听佛歌有什么好处| 瘴气是什么| 净身出户是什么意思| 发愿是什么意思| 猫藓用什么药| 痣为什么会越来越多| 西瓜禁忌和什么一起吃| 安之若素什么意思| 毓读什么| 长明灯是什么意思| 理疗是什么意思| 叶酸片有什么功效| 疟疾病是什么病| 18k金是什么材质| 今年56岁属什么生肖| 脚背上长痣代表什么| 百度Jump to content

[国际足球]友谊赛德国队主场与西班牙握手言和

From Wikipedia, the free encyclopedia
百度 另外,美的旗下的境外公司TITONIINVESTMENTSDEVELOPMENTLTD.持有小天鹅%股份。

In computer science, a nearly-sorted sequence, also known as roughly-sorted sequence and as -sorted sequence is a sequence which is almost ordered. By almost ordered, it is meant that no element of the sequence is very far away from where it would be if the sequence were perfectly ordered. It is still possible that no element of the sequence is at the place where it should be if the sequence were perfectly ordered.

The nearly-sorted sequences are particularly useful when the exact order of element has little importance. For example Twitter[1] nearly sort tweets, up to the second, as there is no need for more precision. Actually, given the impossibility to exactly synchronize all computers, an exact sorting of all tweets according to the time at which they are posted is impossible. This idea led to the creation of Snowflake IDs.

-sorting is the operation of reordering the elements of a sequence so that it becomes -sorted. -sorting is generally more efficient than sorting. Similarly, sorting a sequence is easier if it is known that the sequence is -sorted. So if a program needs only to consider -sorted sequences as input or output, considering -sorted sequences may save time.

The radius of a sequence is a measure of presortedness, that is, its value indicate how much the elements in the list has to be moved to get a totally sorted value. In the above example of tweets which are sorted up to the second, the radius is bounded by the number of tweets in a second.

Definition

[edit]

Given a positive number , a sequence is said to be -sorted if for each and for each , . That is, the sequence has to be ordered only for pairs of elements whose distance is at least .

The radius of the sequence , denoted [2] or [3] is the smallest such that the sequence is -sorted. The radius is a measure of presortedness.

A sequence is said to be nearly-sorted or roughly-sorted if its radius is small compared to its length.

Equivalent definition

[edit]

A sequence is -sorted if and only if each range of length , is -sorted.

Properties

[edit]

All sequences of length are -sorted, that is, . A sequence is -sorted if and only if it is sorted. A -sorted sequence is automatically -sorted but not necessarily -sorted.

Relation with sorted sequences

[edit]

Given a sequence a -sorted sequence and its sorted permutation , is at most .

Algorithms

[edit]

Deciding whether a sequence is k-sorted

[edit]

Deciding whether a sequence is -sorted can be done in linear time and constant space by a streaming algorithm. It suffices, for each , to keep track of and to check that .

Computing the radius of a sequence

[edit]

Computing the radius of a sequence can be computed in linear time and space. This follows from the fact that it can be defined as .

Halving the radius of a sequence

[edit]

Given a -sorted sequence , it is possible to compute a -sorted permutation of in linear time and constant space.

First, given a sequence , lets say that this sequence is partitioned if the -smaller elements are in and the -greater elements are in . Lets call partitioning the action of reordering the sequence into a partitioned permutation. This can be done in linear time by first finding the median of and then moving elements to the first or second half depending on whether they are smaller or greater than the median.

The sequence can be obtained by partitioning the blocks of elements at position , then by partitioning the blocks of elements at position , and then again the elements at position for each number such that those sequences are defined.

Using processors, with no shared read nor write access to memory, the same algorithm can be applied in time, since each partition of a sequence can occur in parallel.

Merging two k-sorted sequences

[edit]

Merging two -sorted sequences and can be done in linear time and constant space.

First, using the preceding algorithm, both sequences should be transformed into -sorted sequences.

Let's construct iteratively an output sequence by removing content from both and adding it in .

If both 's are empty, then it suffices to return . Otherwise, let us assume that is empty and not , it suffices to remove the content of and append it to . The case where is empty and not is similar by symmetry.

Let us consider the case where neither is empty. Let us call and , they are the greatest of the -firsts elements of each list. Let us assume that , the other case is similar by symmetry. Remove from and remove from and add them to .

Sorting a k-sorted sequence

[edit]

A -sorted sequence can be sorted by applying the halving algorithm given above times. This takes time on a sequential machine, or time using processors.

k-sorting a sequence

[edit]

Since each sequence is necessarily -sorted, it suffices to apply the halving algorithm -times. Thus, -sorting can be done in -time. This algorithm is Par-optimal, that is, there exists no sequential algorithm with a better worst-case complexity.

References

[edit]
  1. ^ @rk. "Announcing Snowflake". Twitter blog. Retrieved 26 April 2021.
  2. ^ Altman, Tom; Igarashi, Yoshihide (2025-08-05). "Roughly Sorting: Sequential and Parallel Approach". Journal of Information Processing. 12 (2): 154–158.
  3. ^ Estivill-Castro, Vladimir; Wood, Derick (October 1989). "A new measure of presortdness". Information and Computation. 83 (1): 111–119. doi:10.1016/0890-5401(89)90050-3.
不甚是什么意思 艾滋通过什么途径传播 第一次做什么感觉 丹毒病是什么原因引起的 除服是什么意思
农历10月是什么月 孤寡老人国家有什么政策 为什么打哈欠 7月10号是什么星座 骨折恢复吃什么好
肛周瘙痒是什么原因 丙字五行属什么 胃不好的人吃什么好 马牙是什么原因引起的 有点尿就想尿什么原因导致的
吃牛油果有什么好处 住院需要带什么生活用品 bjd娃娃是什么 男生腿毛旺盛说明什么 怀孕有什么现象
什么人容易得血栓gysmod.com 七叶子是什么意思hebeidezhi.com 嘴唇舌头发麻什么病兆hcv7jop9ns9r.cn 爱出汗吃什么药好hcv7jop9ns4r.cn 丽江机场叫什么名字hcv7jop4ns6r.cn
大枣吃多了有什么危害hcv7jop6ns6r.cn 人心果什么时候成熟hcv8jop8ns3r.cn 天空又什么又什么hcv8jop9ns5r.cn 脱脂牛奶适合什么人喝hcv8jop4ns1r.cn acc是什么意思hcv8jop3ns2r.cn
石青色是什么颜色hcv9jop0ns5r.cn 床咚是什么意思啊hcv8jop3ns1r.cn 什么是1型和2型糖尿病hcv7jop7ns4r.cn 头疼发烧吃什么药huizhijixie.com 月经褐色是什么原因hcv9jop4ns4r.cn
老舍原名什么1949doufunao.com 山什么路xscnpatent.com 梦见前女友是什么预兆hcv8jop4ns0r.cn 左上腹是什么器官hcv8jop3ns9r.cn 血氧低吃什么药效果好hcv9jop1ns1r.cn
百度