经期能吃什么水果| 830是什么意思| 白玫瑰适合送什么人| 亚硝酸钠是什么东西| 黄骨鱼是什么鱼| 四个雷念什么| 肺炎吃什么水果好| 皮肤溃烂化脓用什么药| 日斤念什么字| 腰斩什么意思| 黑色车牌是什么车| 午餐肉是什么肉| 葡萄什么季节成熟| 脊椎炎有什么症状| 什么食物胶原蛋白含量高| 梦见朋友怀孕了是什么意思| 肾脏不好吃什么食物好| 鸡翅木是什么木| 什么是股癣| 手汗脚汗多是什么原因| 印度阿三是什么意思| 面瘫挂什么科室| 100a是什么尺码| 月经时间长是什么原因| 维生素c偏高是什么原因| 素颜霜是干什么用的| 叶酸吃到什么时候| 均为是什么意思| 反绒皮是什么材质| 金骏眉是什么茶| 三聚净戒是指什么戒| 梦见自己被抢劫了预示什么| 属虎生什么属相宝宝好| 范冰冰和洪金宝什么关系| 妇科检查白细胞酯酶阳性是什么意思| 做梦梦见兔子是什么意思| 二郎神叫什么名字| 马上是什么意思| 更的部首是什么| 备孕需要吃什么| 尿检隐血十一什么意思| 天蝎座属于什么象星座| 睡觉出汗是什么原因男性| 12月1日是什么意思| 后入什么意思| 什么药治便秘最好最快| 痛风吃什么药止痛最快| 阿昔洛韦片是什么药| 阿斯利康是什么药| 费气肿要吃什么药| 做梦梦到蜘蛛是什么意思| 晚上做噩梦是什么原因| 中医把脉能看出什么| 小孩口腔溃疡是什么原因| 痣为什么会越来越多| 林彪为什么叛逃| 什么可以代替狗狗沐浴露| 头痛到医院挂什么科| 煮花生放什么调料好吃| 95属什么生肖| 扁桃体溃疡吃什么药| 夜晚咳嗽是什么原因| 宫颈出血是什么原因| 玉是什么结构| 狮子座和什么座最不配| 心字底的字有什么| 射手女跟什么星座最配| 长期便秘吃什么药好| 北京大学什么专业最好| e站是什么| 颈椎病头晕吃什么药| 消炎药有什么| 煤气罐在什么情况下会爆炸| 文旦是什么| 经常拉肚子是什么原因引起的| 吃阿莫西林过敏有什么症状| 驾校教练需要什么条件| 许久是什么意思| 硕的拼音是什么| 梦见摘桃子是什么意思| 预防脑血栓吃什么药好| 砍是什么生肖| 金与什么相生相克| 和尚代表什么生肖| 葡萄糖阴性什么意思| 雷击木有什么作用| 过期啤酒有什么用途| 孩子张嘴睡觉是什么原因| 粗钢是什么| 产后拉肚子是什么原因引起的| 后背疼痛挂什么科| 姜子牙为什么没有封神| 心肌缺血吃什么中药| 无创dna是检查什么的| 入睡困难吃什么药| 杜牧字什么| 肺炎后遗症有什么症状| 立碑有什么讲究和忌讳| 橘子什么时候成熟| 胰腺疼痛吃什么药| 雷锋原名叫什么| galaxy是什么牌子| 为什么会突然长体癣| 宫腔回声不均匀什么原因| 淋巴细胞计数偏高是什么原因| 白芍的功效与作用是什么| 车牌颜色代表什么| 黑眼圈严重是什么原因| 早上4点是什么时辰| 胸膜牵拉是什么意思| 兵痞是什么意思| 兵马未动粮草先行是什么意思| 独断万古是什么意思| 金风送爽是什么意思| 暴躁是什么意思| 茯苓有什么功效| 10月24是什么星座| 罗汉果有什么作用| 什么是孤独| 时机是什么意思| fizz是什么意思| 梦到点火是什么意思| 老抽和生抽有什么区别| 脉搏是什么意思| 阴险表情什么意思| 什么高什么长| 现役是什么意思| 营养性贫血是什么意思| 白切鸡用什么鸡| 小学什么时候放暑假| 鸡皮肤是什么原因引起的| 枭印什么意思| 为什么一喝水就出汗| 什么叫中出| 1977年是什么年| 2017年属鸡的是什么命| 上呼吸道感染吃什么中成药| 菱形脸适合什么发型| BLD医学上是什么意思| 无花果叶子有什么功效| 大姨妈吃什么水果| 宫腔线分离是什么意思| 陶白白是什么星座| 彩虹有什么颜色| 9月3日是什么纪念日| 红楼梦为什么叫石头记| 阴茎皮开裂是什么原因| 去三亚需要什么证件| 27年属什么生肖| 震字五行属什么| lauren是什么意思| maby什么意思| 鸡肉和什么菜搭配最好| 爆肝是什么意思| oct是什么| 大学记过处分有什么影响| 地主之谊是什么意思| 毕业送老师什么礼物好| 看金鱼是什么梗| 三点水一个高念什么| 灬是什么意思| 如来佛祖叫什么名字| 惊弓之鸟告诉我们什么道理| max什么意思| 血小板是什么| 什么风什么月| 的作用是什么| 为什么不能在一起| 菊花代表什么象征意义| 梦见下雪是什么| 椒盐是什么| 夏至是什么意思| 牛有几个胃分别叫什么| 死亡是什么感觉| 2017年什么年| 上善若水是什么意思| 胚芽米是什么米| 深蹲有什么好处| 柳树像什么| 头上长了个包挂什么科| 喝碳酸饮料有什么危害| 回春是什么意思| 所谓是什么意思| alpha什么意思| 舌头溃疡吃什么药| 吃什么蔬菜可以降血脂| 龙眼是什么| 热水器什么品牌好| 竹代表什么生肖| 梨和什么一起榨汁好喝| 什么的草帽| 肝损伤吃什么药| 骨蒸潮热是什么意思| arf是什么意思| 肚子总胀气是什么原因| 收入是什么意思| 刑警是干什么的| 四季春茶是什么茶| 炮烙之刑是什么意思| 妈祖是什么| 至加秦是什么字| 血尿是什么颜色的| 丹凤眼是什么样| 氟斑牙是什么原因造成的| 精神寄托是什么意思| 来月经吃什么对身体好| 什么是嘌呤| 为什么胃酸会分泌过多| 复仇者用什么武器| 元宝是什么意思| 指甲月牙白代表什么| 孩子脾胃虚弱吃什么药| 拉肚子吃什么水果| 吃饭快了有什么坏处| 蜜蜂糖冲开水有什么好处| 贝壳吃什么食物| 脚心疼是什么原因| 手脚热是什么原因| 湾湾是什么意思| 盐酸氯米帕明片有什么作用| 口腔痛什么原因| 王爷是皇上的什么人| 胎盘附着于子宫前壁是什么意思| 性疾病都有什么症状| 刺激是什么意思| HCG 是什么| 反复呕吐是什么原因| 醉酒第二天吃什么才能缓解难受| 殁送是什么意思| e m s是什么快递| 肠梗阻挂什么科| 吃什么水果补血| 致爱是什么意思| 持续低烧不退是什么原因| 球蛋白偏高是什么原因| 可乐是什么做的| 肚脐右边按压疼是什么原因| 包皮什么意思| dido是什么牌子| 胃低分化腺癌是什么意思| 绝技是什么意思| 窦性心律过速是什么意思| 为什么暑假比寒假长| 新西兰移民需要什么条件| 竹荪是什么| 嘎哈是什么意思| 孕酮低吃什么补得快| 四级军士长是什么级别| 葳是什么意思| 跑步胸口疼什么原因| 孕妇有血窦要注意什么| 吃无花果有什么好处和坏处| 洪字五行属什么| 班门弄斧什么意思| 蒙昧是什么意思| 一根筋是什么意思| 溃疡是什么意思| 年柱比肩是什么意思| 情字五行属什么| 男人高冷是什么意思啊| live什么意思| 红斑狼疮是什么原因引起的| 包涵是什么意思| 喉咙疼吃什么消炎药| 百度Jump to content

杨秀萍秘书长在中国—东盟中心成立四周年招待会上的致辞

From Wikipedia, the free encyclopedia
百度 被电击后身体会有什么后遗症

In computer science, a search data structure[citation needed] is any data structure that allows the efficient retrieval of specific items from a set of items, such as a specific record from a database.

The simplest, most general, and least efficient search structure is merely an unordered sequential list of all the items. Locating the desired item in such a list, by the linear search method, inevitably requires a number of operations proportional to the number n of items, in the worst case as well as in the average case. Useful search data structures allow faster retrieval; however, they are limited to queries of some specific kind. Moreover, since the cost of building such structures is at least proportional to n, they only pay off if several queries are to be performed on the same database (or on a database that changes little between queries).

Static search structures are designed for answering many queries on a fixed database; dynamic structures also allow insertion, deletion, or modification of items between successive queries. In the dynamic case, one must also consider the cost of fixing the search structure to account for the changes in the database.

Classification

[edit]

The simplest kind of query is to locate a record that has a specific field (the key) equal to a specified value v. Other common kinds of query are "find the item with smallest (or largest) key value", "find the item with largest key value not exceeding v", "find all items with key values between specified bounds vmin and vmax".

In certain databases the key values may be points in some multi-dimensional space. For example, the key may be a geographic position (latitude and longitude) on the Earth. In that case, common kinds of queries are "find the record with a key closest to a given point v", or "find all items whose key lies at a given distance from v", or "find all items within a specified region R of the space".

A common special case of the latter are simultaneous range queries on two or more simple keys, such as "find all employee records with salary between 50,000 and 100,000 and hired between 1995 and 2007".

Single ordered keys

[edit]

Finding the smallest element

[edit]

Asymptotic worst-case analysis

[edit]

In this table, the asymptotic notation O(f(n)) means "not exceeding some fixed multiple of f(n) in the worst case."

Data Structure Insert Delete Balance Get at index Search Find minimum Find maximum Space usage
Unsorted array O(1)
(see note)
O(1)
(see note)
N/A O(1) O(n) O(n) O(n) O(n)
Sorted array O(n) O(n) N/A O(1) O(log n) O(1) O(1) O(n)
Stack O(1) O(1) O(n) O(n)
Queue O(1) O(1) O(n) O(n)
Unsorted linked list O(1) O(1)[1] N/A O(n) O(n) O(n) O(n) O(n)
Sorted linked list O(n) O(1)[1] N/A O(n) O(n) O(1) O(1) O(n)
Skip list
Self-balancing binary search tree O(log n) O(log n) O(log n) N/A O(log n) O(log n) O(log n) O(n)
Heap O(log n) O(log n) O(log n) N/A O(n) O(1) for a min-heap
O(n) for a max-heap[2]
O(1) for a max-heap
O(n) for a min-heap[2]
O(n)
Hash table O(1) O(1) O(n) N/A O(1) O(n) O(n) O(n)
Trie (k = average length of key) O(k) O(k) N/A O(k) O(k) O(k) O(k) O(k n)
Cartesian tree
B-tree O(log n) O(log n) O(log n) N/A O(log n) O(log n) O(log n) O(n)
Red–black tree O(log n) O(log n) O(log n) O(n)
Splay tree
AVL tree O(log n)
k-d tree

Note: Insert on an unsorted array is sometimes quoted as being O(n) due to the assumption that the element to be inserted must be inserted at one particular location of the array, which would require shifting all the subsequent elements by one position. However, in a classic array, the array is used to store arbitrary unsorted elements, and hence the exact position of any given element is of no consequence, and insert is carried out by increasing the array size by 1 and storing the element at the end of the array, which is a O(1) operation.[3][4] Likewise, the deletion operation is sometimes quoted as being O(n) due to the assumption that subsequent elements must be shifted, but in a classic unsorted array the order is unimportant (though elements are implicitly ordered by insert-time), so deletion can be carried out by swapping the element to be deleted with the last element in the array and then decrementing the array size by 1, which is a O(1) operation.[5]

This table is only an approximate summary; for each data structure there are special situations and variants that may lead to different costs. Also two or more data structures can be combined to obtain lower costs.

Footnotes

[edit]
  1. ^ a b Thomas H. Cormen; Charles E. Leiserson; Ronald L. Rivest (1990). Introduction to Algorithms. The College of Information Sciences and Technology at Penn State. ISBN 978-0-262-53091-0. LIST-DELETE runs in O(1) time, but if to delete an element with a given key, Θ(n) time is required in the worst case because we must first call LIST-SEARCH.
  2. ^ a b Thomas H. Cormen; Charles E. Leiserson; Ronald L. Rivest (1990). Introduction to Algorithms. The College of Information Sciences and Technology at Penn State. ISBN 978-0-262-53091-0. There are two kinds of binary heaps: max-heaps and min-heaps. In both kinds, the values in the nodes satisfy a heap property... the largest element in a max-heap is stored at the root... The smallest element in a min-heap is at the root... The operation HEAP-MAXIMUM returns the maximum heap element in Θ(1) time by simply returning the value A[1] in the heap.
  3. ^ Allen Sherrod (2007). Data Structures and Algorithms for Game Developers. Cengage Learning. ISBN 978-1-58450-663-8. The insertion of an item into an unordered array does not depend on anything other than placing the new item at the end of the list. This gives the insertion into an unordered array of O(1).
  4. ^ Thomas H. Cormen; Charles E. Leiserson; Ronald L. Rivest (1990). Introduction to Algorithms. The College of Information Sciences and Technology at Penn State. ISBN 978-0-262-53091-0.
  5. ^ "Algorithm - the time complexity of deletion in a unsorted array". Finding the element with a given value is linear. Since the array isn't sorted anyway, you can do the deletion itself in constant time. First swap the element you want to delete to the end of the array, then reduce the array size by one element.

See also

[edit]
神经性梅毒有什么症状 小蓝片是什么 甲状腺是什么病啊 ac什么意思 婴儿拉奶瓣是什么原因
蜘蛛痣是什么样的 男人为什么喜欢女人 波菜不能和什么一起吃 梦见枪毙人是什么意思 半边脸疼是什么原因引起的
衤叫什么偏旁 牙痛吃什么消炎药 什么是微循环 篮子是什么意思 胰腺检查做什么检查
走之旁与什么有关 志趣相投是什么意思 七月什么星座 尿液红细胞高是什么原因 五月二十三日是什么星座
脚发痒是什么原因hcv7jop6ns6r.cn 竹笋炒什么好吃hcv7jop6ns5r.cn 89年五行属什么hcv8jop0ns1r.cn 旻字五行属什么hcv9jop0ns8r.cn 梦见自己梳头发是什么意思hcv7jop9ns0r.cn
手足口病是什么病毒hcv9jop0ns2r.cn 工资5k是什么意思hcv8jop7ns6r.cn 裸婚什么意思hcv8jop6ns7r.cn 用盐水漱口有什么好处1949doufunao.com 睡觉放屁是什么原因hcv8jop6ns6r.cn
寓言故事有什么hcv9jop0ns4r.cn 破军星是什么意思hcv9jop0ns4r.cn 1971年是什么年cj623037.com 什么样的房子不能住人脑筋急转弯hcv8jop1ns1r.cn 一抹多是什么意思hcv8jop8ns8r.cn
小孩肚脐周围疼是什么原因hcv8jop7ns5r.cn 亚历山大王什么档次hcv8jop8ns3r.cn 尿道口发痒是什么原因hcv8jop7ns6r.cn 中指和无名指一样长代表什么hcv9jop6ns9r.cn 肠粘连会有什么症状hcv8jop6ns4r.cn
百度