Null pointer Created 2026-10-24 Updated 2026-10-31
A null pointer is a distinguished pointer value that designates no object or function. Pointer-linked binary trees commonly use it to represent an absent child. Dereferencing it is invalid; its representation is target dependent, although AAPCS32 specifies an all-zero null representation.
A trie node needs a terminal flag as well as its children: a stored word can also be the prefix of a longer stored word.Index zero denotes
TYPE Trie = POINTER TO Node;
Node = RECORD
terminal: BOOLEAN;
child: ARRAY 26 OF Trie
END;a, index 25 denotes z; null pointers denote absent branches. The set represented by a nonnull node consists of the empty string if terminal is true, together with every child's words prefixed by that child's letter. Represent the empty set by NIL. The singleton containing the empty string instead has a terminal root and no children.The declarations alone do not force a unique representation. A nonterminal leaf, or a whole branch without terminal descendants, contributes no word. To obtain uniqueness up to pointer addresses, impose a representation invariant: the structure is a finite rooted tree, and each allocated node lies on a path to a terminal node. Then precisely the prefixes of stored words exist, all flags are determined, and the empty set has only the
NIL representation. The insertion procedures below preserve this invariant when starting with such a trie. Pointer (computer programming) 2026-10-24
A pointer is a value designating a location in a program's memory model, or a special value such as a null pointer that designates no object. A node in a pointer-linked binary tree stores pointers to its two children. Representation, size, alignment and the validity of dereferencing depend on the programming language and target; 32-bit AAPCS32 data pointers occupy four bytes.