List
A list is an ordered sequence of items treated as a single unit. The ordering may carry meaning (a ranked list, a procedure) or may be arbitrary (a grocery list, an inventory). What makes a list a list is that the items are gathered together and can be traversed from first to last.
Lists are among the most basic structures for organizing things. A container holds things spatially; a list holds things sequentially. Every table of contents is a list. Every set of instructions is a list. Every index, queue, ledger, and catalog is a list or is built from one.
In computing, a list is a fundamental data structure โ an ordered collection where elements can be accessed by position. Lisp (1958) took the list as its primary structure and built an entire language around the operations of constructing, decomposing, and traversing lists. The insight was that lists are general enough to represent nearly anything: data, code, and the structure of computation itself.
A list differs from a set in that order and repetition matter. The list [A, B, A] has three items; the set {A, B} has two. A list differs from a sequence in that it is finite and discrete โ you can count the items and point to the last one.
Last reviewed .