Expression Tree

Why Trust Techopedia

What Does Expression Tree Mean?

An expression tree is a representation of expressions arranged in a tree-like data structure. In other words, it is a tree with leaves as operands of the expression and nodes contain the operators. Similar to other data structures, data interaction is also possible in an expression tree. Expression trees are mainly used for analyzing, evaluating and modifying expressions, especially complex expressions.

Advertisements

Techopedia Explains Expression Tree

Expression trees are one of the best techniques to represent language-level code in the form of data, which is stored in a tree-shaped structure. An expression tree is considered an in-memory representation of a lambda expression. The tree makes the structure containing the lambda expression more explicit and transparent. The expression tree was created for converting code into string that is capable of being passed on to other processes as inputs. It holds the actual elements involved in the query, and not the actual result of the query.

One of the important properties of expression trees is that they are immutable, meaning in order to modify an existing expression tree, a new expression tree needs to be constructed by copying and modifying the existing tree expression. When it comes to programming, an expression tree is usually built with postfix expressions, in which one symbol is read at a time. If the symbol is an operand, a one-node tree is created and a pointer to it is pushed into a stack.

Advertisements

Related Terms

Margaret Rouse
Editor

Margaret jest nagradzaną technical writerką, nauczycielką i wykładowczynią. Jest znana z tego, że potrafi w prostych słowach pzybliżyć złożone pojęcia techniczne słuchaczom ze świata biznesu. Od dwudziestu lat jej definicje pojęć z dziedziny IT są publikowane przez Que w encyklopedii terminów technologicznych, a także cytowane w artykułach ukazujących się w New York Times, w magazynie Time, USA Today, ZDNet, a także w magazynach PC i Discovery. Margaret dołączyła do zespołu Techopedii w roku 2011. Margaret lubi pomagać znaleźć wspólny język specjalistom ze świata biznesu i IT. W swojej pracy, jak sama mówi, buduje mosty między tymi dwiema domenami, w ten…