language-icon Old Web
English
Sign In

Append

In general, to append is to join or add on to the end of something. For example, an appendix is a section appended (added to the end) of a document. In general, to append is to join or add on to the end of something. For example, an appendix is a section appended (added to the end) of a document. In computer programming, append is the name of a procedure for concatenating (linked) lists or arrays in some high-level programming languages. Append originates in the Lisp programming language. The append procedure takes zero or more (linked) lists as arguments, and returns the concatenation of these lists. Since the append procedure must completely copy all of its arguments except the last, both its time and space complexity are O(n) for a list of n {displaystyle n} elements. It may thus be a source of inefficiency if used injudiciously in code. The nconc procedure (called append! in Scheme) performs the same function as append, but destructively: it alters the cdr of each argument (save the last), pointing it to the next list. Append can easily be defined recursively in terms of cons. The following is a simple implementation in Scheme, for two arguments only:

[ "Programming language" ]
Parent Topic
Child Topic
    No Parent Topic