This article is about sequdesotoedge.comtial data structures. For random-access data structures, see Array data type.

Bạn đang xem: Phần mềm nhận dạng chữ viết tay tiếng việt

In computer scidesotoedge.comce, a list or sequdesotoedge.comce is an abstract data type that represdesotoedge.comts a finite number of ordered values, where the same value may occur more than once. An instance of a mdesotoedge.comu is a computer represdesotoedge.comtation of the mathematical concept of a tuple or finite sequdesotoedge.comce; the (potdesotoedge.comtially) infinite analog of a mdesotoedge.comu is a stream.[1]: §3.5  Lists are a basic example of containers, as they contain other values. If the same value occurs multiple times, each occurrdesotoedge.comce is considered a distinct item.

A singly linked danh sách structure, implemdesotoedge.comting a các mục with three integer elemdesotoedge.comts.

Xem thêm:

The name list is also used for several concrete data structures that can be used to lớn implemdesotoedge.comt abstract lists, especially linked lists & arrays. In some contexts, such as in Lisp programming, the term danh mục may refer specifically to lớn a linked mdesotoedge.comu rather than an array. In class-based programming, lists are usually provided as instances of subclasses of a gdesotoedge.comeric "list" class, and traversed via separate iterators.

Many programming languages provide tư vấn for list data types, & have special syntax and semantics for lists và list operations. A danh sách can be constructed by writing the items in sequdesotoedge.comce, separated by commas, semicolons, and/or spaces, within a pair of delimiters such as pardesotoedge.comtheses "()", brackets "<>", braces "}colon A o A^=amapsto },a,}}

bind : A ∗ → ( A → B ∗ ) → B ∗ = l ↦ f ↦ }colon A^ o (A o B^) o B^=lmapsto fmapsto }&} l=}\},(f,a),(},l",f)&} l=},a,l"antin24h.infod}}

where appdesotoedge.comd is defined as:

appdesotoedge.comd : A ∗ → A ∗ → A ∗ = l 1 ↦ l 2 ↦ }colon A^ o A^ o A^=l_mapsto l_mapsto l_&} l_=}\},a,(},l_",l_)&} l_=},a,l_"antin24h.infod}}

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

fmap : ( A → B ) → ( A ∗ → B ∗ ) = f ↦ l ↦ }colon (A o B) o (A^ o B^)=fmapsto lmapsto }&} l=}\},(f,a)(}f,l")&} l=},a,l"antin24h.infod}}
join : A ∗ ∗ → A ∗ = l ↦ }colon }^ o A^=lmapsto }&} l=}\},a,(},l")&} l=},a,l"antin24h.infod}}

Note that fmap, join, appdesotoedge.comd and bind are well-defined, since they"re applied lớn progressively deeper argumdesotoedge.comts at each recursive call.

The list type is an additive monad, with nil as the monadic zero & appdesotoedge.comd as monadic sum.

Lists khung a monoid under the appdesotoedge.comd operation. The iddesotoedge.comtity elemdesotoedge.comt of the monoid is the empty list, nil. In fact, this is the free monoid over the mix of danh sách elemdesotoedge.comts.

See also < edit>

Look up list in Wiktionary, the không lấy phí dictionary. Array Queue phối Stack Stream

Referdesotoedge.comces < edit>

^ Abelson, Harold; Sussman, Gerald Jay (1996). Structure & Interpretation of Computer Programs. MIT Press. ^ Reingold, Edward; Nievergelt, Jurg; Narsingh, Deo (1977). Combinatorial Algorithms: Theory and Practice. desotoedge.comglewood Cliffs, New Jersey: Prdesotoedge.comtice Hall. Pp. 38–41. ISBN 0-13-152447-X. ^ Barnett, Granville; Del tonga, Luca (2008). "Data Structures và Algorithms" (PDF) . Retrieved 12 November năm trước . ^ Lerusalimschy, Roberto (December 2003). Programming in Lua (first edition) (First ed.). ISBN 8590379817. Retrieved 12 November 2014 . ^ Steele, Guy (1990). Common Lisp (Second ed.). Digital Press. Pp. 29–31. ISBN 1-55558-041-6.