前庭功能是什么意思| 动物都有什么| 鸡的祖先是什么动物| 脚脖子疼是什么原因| 珍珠是用什么做的| 拔牙之前要注意什么| 1943年属什么生肖| 清热去火吃什么药| 喝中药可以吃什么水果| 打黄体酮针有什么副作用| 葵花宝典是什么意思| 见不得别人好是什么心理| 什么是耐药性| 黄鼻涕是什么类型的感冒| 心电图低电压什么意思| 舌苔厚黄是怎么回事吃什么药| 五海瘿瘤丸主要治什么病| 长期大便不成形是什么原因造成的| 高代表什么生肖| 毛囊炎长什么样| 尿血是什么原因引起的| 梦到吃饭是什么意思| 什么清什么秀| 内痔疮用什么药治最好效果最快| 中国的国球是什么| picc什么意思| 胃胀不舒服吃什么药| 去减一笔变成什么字| 无名指和食指一样长代表什么| 脚心疼什么原因| 吃什么最补胶原蛋白| 藏红花和什么一起泡水喝效果好| 明前茶什么意思| 悦五行属性是什么| 智能眼镜有什么功能| 无名指和食指一样长代表什么| 美育是什么| 结肠炎适合吃什么食物| 德国用什么货币| 1987年出生属什么生肖| 盲约大结局是什么| 大牙什么时候换| 什么是邮箱地址应该怎么填写| 让您费心了是什么意思| 吃蒸苹果有什么好处| 手忙脚乱是什么意思| 什么是躯体化症状表现| 儿童头晕挂什么科| 夜里12点是什么时辰| 自戕是什么意思| 封神榜讲的是什么故事| 什么食物降血糖| siemens是什么品牌| 龘读什么| 老婆饼是什么馅| 孕妇梦见坟墓是什么预兆| 光纤和宽带有什么区别| 狗怕什么| 璨字五行属什么| 黄瓜炒什么| 五鬼是什么意思| semir是什么牌子| 木犀读什么| 98年属什么| lining是什么意思| 臭嗨是什么意思| 足跟痛是什么原因| 舌头两边锯齿状是什么原因| 颈动脉彩超挂什么科| 书店买不到的书是什么书| 血塞通治什么病最好| 做什么生意好挣钱| 牙龈发炎用什么药| 孕妇梦见牛是什么意思| 为什么总是头晕| 欢字五行属什么| 腿脚肿胀是什么原因引起的| 万年历是什么| 和氏璧是什么玉| 鱼用什么呼吸| 箬叶和粽叶有什么区别| 学生是什么阶级| 翊字五行属什么| 全职什么意思| 芒果和什么相克| 一模一样的意思是什么| 喉咙干痒是什么原因| 太阳黑子是什么东西| 张艺兴为什么不退出exo| 维脑路通又叫什么| 一个口一个坐念什么| cpi下降意味着什么| 儿童鼻窦炎吃什么药| 什么样的花纹| 跖疣用什么药膏能治好| 碘缺乏会导致什么疾病| 麻腮风疫苗什么时候打| 什么炖鸡好吃| 宫颈炎是什么原因引起的| 化疗和放疗有什么区别| 尿常规隐血弱阳性什么意思| 安之若素是什么意思| 高考什么时候恢复的| 2044年是什么年| 下体瘙痒用什么药| nars是什么牌子| 肺纹理增多什么意思| 胆小怕事是什么生肖| 什么是精神分裂| 冰心原名叫什么名字| 为什么屁多是什么原因| 老鹰代表什么生肖| 段子是什么意思| 石女什么意思| 老班章是什么茶| 手书是什么| 天蝎座什么象星座| 开什么店好| rio是什么酒| 处暑的处是什么意思| 如泰山前面一个字是什么啊| dm是什么单位| 蘑菇炒什么好吃| 前额头疼是什么原因引起的| 促甲状腺激素低是什么原因| 什么奶粉比较好| 59年属什么生肖| 子宫肌瘤伴钙化是什么意思| 为什么长疣| 1984年属什么生肖| 饱不洗头饿不洗澡是为什么| 艮什么意思| 肾看什么科| 符咒是什么意思| psa升高代表什么| 肠胃不好吃什么药好| 百香果有什么功效| 腰椎疼挂什么科| 安宫丸什么时候吃| 想留不能留才最寂寞是什么歌| eso是什么意思| 金火什么字| 40而不惑是什么意思| 肚子胀是什么原因引起的| 油嘴滑舌指什么生肖| 水瓜壳煲水有什么功效| 梦见自己家盖房子是什么预兆| 喉咙干咳嗽是什么原因| 感恩节吃什么| 头发染什么颜色显皮肤白显年轻| 做头发是什么意思| 稍高回声是什么意思| 善男信女什么意思| 足金是什么意思| 甘少一横读什么| ifu是什么意思| 五月天主唱叫什么名字| 口炎读什么| 哇噻是什么意思| 蟋蟀喜欢吃什么| 什么叫集体户口| 皮肤瘙痒用什么药| 南非叶主治什么病| 腰椎钙化是什么意思| 为什么会得偏头痛| 疝气是什么病怎样治疗| 腰椎间盘突出挂什么科室| 1月3号什么星座| 277是什么意思| 喝什么茶最养胃| 蒸汽机是什么| 附睾炎是什么原因引起的| 松茸是什么东西| 茄子什么人不能吃| 梦见很多蜘蛛是什么意思| 什么是g大调| 夫妇是什么意思| 吃薄荷对人身体有什么好处| 看痘痘挂什么科| 90年属什么| 考上公务员意味着什么| 什么食物含叶酸多| 拉肚子什么原因| 士加一笔是什么字| 妈宝男什么意思| 劳苦功高是什么意思| 阿西是什么意思| 什么叫meta分析| 榴莲不能与什么食物一起吃| 无中生有是什么意思| 螃蟹喜欢吃什么食物| 66岁属什么| 流鼻血是什么引起的| 动物园里有什么动物| 朝鲜为什么闭关锁国| 酩酊是什么意思| 肝右叶钙化灶什么意思| 阴茎瘙痒是什么原因| 冠心病有什么症状| 天灾人祸什么意思| 久负盛名的负是什么意思| 身上长黑痣是什么原因| 狗狗打疫苗前后要注意什么| opple是什么牌子| 可怜巴巴是什么意思| 喉咙里痰多是什么原因| 什么叫高潮| 杳什么意思| 免漆板是什么板材| 1880年是什么朝代| 茶叶含有什么成分| 什么是a货翡翠| 今天什么节日| 银杏叶像什么| 龙眼是什么季节的水果| 大学生入伍有什么好处| 甲沟炎是什么引起的| 凭什么| 头发湿着睡觉有什么害处| 依托考昔片是什么药| 肾阳虚吃什么药好| 办身份证要穿什么衣服| 甜菜根是什么| 821是什么星座| 微量元素挂什么科| 什么地坐着| 吃什么全面补充维生素| 吉人自有天相是什么意思| 葬礼穿什么衣服| 脑梗会有什么后遗症| 山青读什么| 治股癣用什么药最好| 开塞露擦脸有什么效果| 感冒咳嗽一直不好是什么原因| 想吐吃什么药可以缓解| 甲钴胺片治疗什么病| 镇团委书记是什么级别| 社会抚养费是什么意思| 五月二十八是什么日子| 油菜是什么菜| 耳鼻喉属于什么科| 月经期适合做什么运动| 高血压吃什么食物好| 手麻吃什么药最好| 膝盖有积液是什么症状| 产后漏尿是什么原因| 什么东西泡水喝降血压| 什么头什么气| wpc是什么意思| 血管堵塞吃什么好| 老鼠喜欢吃什么| 感知能力是什么意思| gdp是什么| 山梨糖醇是什么| 蛋皮痒痒是什么病| 面瘫看什么科室好| 肝脏的作用是什么| 真身是什么意思| 胆固醇高是什么原因引起的| 鱼的偏旁部首是什么| 缺维生素b吃什么食物| 冰粉是什么| 为什么白带是黄色的| 红细胞分布宽度偏低是什么意思| 百度Jump to content

北京二手房一年先后5次降价 共降250万仍没卖出去二手房报价业主

From Wikipedia, the free encyclopedia
(Redirected from List (computing))
百度 其中著名的大学图书馆包括:英国哈佛商学院图书馆、普林斯顿大学图书馆、杜克大学图书馆、加州大学伯克利分校图书馆、哥伦比亚大学图书馆、纽约大学图书馆、芝加哥大学图书馆,新加坡南洋理工大学图书馆,澳大利亚墨尔本大学图书馆,加拿大多伦多大学图书馆、阿尔伯塔大学图书馆,香港大学图书馆,英国的伦敦政治经济大学图书馆、爱丁堡大学图书馆等;政府机构包括新加坡国立图书馆、大英图书馆、澳大利亚国立图书馆;著名公司包括:花旗银行、MeyerBrown师行等跨国公司图书馆。

In computer science, a list or sequence is a collection of items that are finite in number and in a particular order. An instance of a list is a computer representation of the mathematical concept of a tuple or finite sequence.

A list may contain the same value more than once, and each occurrence is considered a distinct item.

A singly-linked list structure, implementing a list with three integer elements.

The term list is also used for several concrete data structures that can be used to implement abstract lists, especially linked lists and arrays. In some contexts, such as in Lisp programming, the term list may refer specifically to a linked list rather than an array. In class-based programming, lists are usually provided as instances of subclasses of a generic "list" class, and traversed via separate iterators.

Many programming languages provide support for list data types, and have special syntax and semantics for lists and list operations. A list can often be constructed by writing the items in sequence, separated by commas, semicolons, and/or spaces, within a pair of delimiters such as parentheses '()', brackets '[]', braces '{}', or angle brackets '<>'. Some languages may allow list types to be indexed or sliced like array types, in which case the data type is more accurately described as an array.

In type theory and functional programming, abstract lists are usually defined inductively by two operations: nil that yields the empty list, and cons, which adds an item at the beginning of a list.[1]

A stream is the potentially infinite analog of a list.[2]:?§3.5?

Operations

[edit]

Implementation of the list data structure may provide some of the following operations:

  • create
  • test for empty
  • add item to beginning or end
  • access the first or last item
  • access an item by index

Implementations

[edit]

Lists are typically implemented either as linked lists (either singly or doubly linked) or as arrays, usually variable length or dynamic arrays.

The standard way of implementing lists, originating with the programming language Lisp, is to have each element of the list contain both its value and a pointer indicating the location of the next element in the list. This results in either a linked list or a tree, depending on whether the list has nested sublists. Some older Lisp implementations (such as the Lisp implementation of the Symbolics 3600) also supported "compressed lists" (using CDR coding) which had a special internal representation (invisible to the user). Lists can be manipulated using iteration or recursion. The former is often preferred in imperative programming languages, while the latter is the norm in functional languages.

Lists can be implemented as self-balancing binary search trees holding index-value pairs, providing equal-time access to any element (e.g. all residing in the fringe, and internal nodes storing the right-most child's index, used to guide the search), taking the time logarithmic in the list's size, but as long as it doesn't change much will provide the illusion of random access and enable swap, prefix and append operations in logarithmic time as well.[3]

Programming language support

[edit]

Some languages do not offer a list data structure, but offer the use of associative arrays or some kind of table to emulate lists. For example, Lua provides tables. Although Lua stores lists that have numerical indices as arrays internally, they still appear as dictionaries.[4]

In Lisp, lists are the fundamental data type and can represent both program code and data. In most dialects, the list of the first three prime numbers could be written as (list 2 3 5). In several dialects of Lisp, including Scheme, a list is a collection of pairs, consisting of a value and a pointer to the next pair (or null value), making a singly linked list.[5]

Applications

[edit]

Unlike in an array, a list can expand and shrink.

In computing, lists are easier to implement than sets. A finite set in the mathematical sense can be realized as a list with additional restrictions; that is, duplicate elements are disallowed and order is irrelevant. Sorting the list speeds up determining if a given item is already in the set, but in order to ensure the order, it requires more time to add new entry to the list. In efficient implementations, however, sets are implemented using self-balancing binary search trees or hash tables, rather than a list.

Lists also form the basis for other abstract data types including the queue, the stack, and their variations.

Abstract definition

[edit]

The abstract list type L with elements of some type E (a monomorphic list) is defined by the following functions:

nil: () → L
cons: E × LL
first: LE
rest: LL

with the axioms

first (cons (e, l)) = e
rest (cons (e, l)) = l

for any element e and any list l. It is implicit that

cons (e, l) ≠ l
cons (e, l) ≠ e
cons (e1, l1) = cons (e2, l2) if e1 = e2 and l1 = l2

Note that first (nil ()) and rest (nil ()) are not defined.

These axioms are equivalent to those of the abstract stack data type.

In type theory, the above definition is more simply regarded as an inductive type defined in terms of constructors: nil and cons. In algebraic terms, this can be represented as the transformation 1 + E × LL. first and rest are then obtained by pattern matching on the cons constructor and separately handling the nil case.

The list monad

[edit]

The list type forms a monad with the following functions (using E* rather than L to represent monomorphic lists with elements of type E):

where append is defined as:

Alternatively, the monad may be defined in terms of operations return, fmap and join, with:

Note that fmap, join, append and bind are well-defined, since they're applied to progressively deeper arguments at each recursive call.

The list type is an additive monad, with nil as the monadic zero and append as monadic sum.

Lists form a monoid under the append operation. The identity element of the monoid is the empty list, nil. In fact, this is the free monoid over the set of list elements.

See also

[edit]
  • Array data type – Data type that represents an ordered collection of elements (values or variables)
  • Queue – Abstract data type
  • Set – Abstract data type for storing unique values
  • Stack – Abstract data type
  • Stream – Sequence of data items available over time

References

[edit]
  1. ^ Reingold, Edward; Nievergelt, Jurg; Narsingh, Deo (1977). Combinatorial Algorithms: Theory and Practice. Englewood Cliffs, New Jersey: Prentice Hall. pp. 38–41. ISBN 0-13-152447-X.
  2. ^ Abelson, Harold; Sussman, Gerald Jay (1996). Structure and Interpretation of Computer Programs. MIT Press.
  3. ^ Barnett, Granville; Del tonga, Luca (2008). "Data Structures and Algorithms" (PDF). mta.ca. Retrieved 12 November 2014.
  4. ^ Lerusalimschy, Roberto (December 2003). Programming in Lua (first edition) (First ed.). Lua.org. ISBN 8590379817. Retrieved 12 November 2014.
  5. ^ Steele, Guy (1990). Common Lisp (Second ed.). Digital Press. pp. 29–31. ISBN 1-55558-041-6.
右手有痣代表什么 菊花泡水喝有什么功效 小孩便秘吃什么药 空调干燥是什么意思 井井有条是什么意思
23是什么生肖 暂告一段落是什么意思 字母哥什么位置 衤字旁的字与什么有关 一什么湖水
女人白带多是什么原因 pt950是什么金 大头儿子叫什么名字 诸葛亮是什么星座 黑色的裤子配什么颜色的上衣
术后病人吃什么营养恢复快 什么明月 执迷不悟是什么生肖 tia是什么 吃饭睡觉打豆豆是什么意思
履是什么意思hcv7jop6ns1r.cn 眼睛的晶体是什么hcv9jop4ns4r.cn 集少两撇是什么字hcv9jop6ns6r.cn 肺气肿吃什么药hcv9jop4ns6r.cn 乳房旁边疼是什么原因gysmod.com
三体是什么hcv9jop1ns7r.cn 看头部挂什么科hcv8jop0ns2r.cn 龙井是什么茶hcv8jop1ns9r.cn 什么人不适合喝骆驼奶hcv9jop7ns1r.cn 规培证什么时候发sanhestory.com
什么是双氧水hcv8jop3ns4r.cn 越南用什么语言hcv9jop4ns2r.cn 7月8号是什么星座的hcv9jop0ns6r.cn 脑梗能吃什么zsyouku.com 什么情况下吃救心丸hcv8jop5ns8r.cn
拉稀吃什么药好hcv9jop1ns2r.cn 青少年梦遗有什么危害hcv8jop4ns3r.cn 盛情款待是什么意思hcv9jop3ns4r.cn 夏天适合种植什么蔬菜hcv8jop0ns6r.cn 什么路最窄打一生肖hcv9jop4ns7r.cn
百度