Newick format offers a way of representing binary trees in text form by using parentheses and commas. Here's an example of a straightforward rooted tree.

According to this tree, taxa

The above rooted tree, which is more complex, can be represented by the following steps:

- consolidate
$a$ and$c$ into$(a, c)$ ; - consolidate
$(a, c)$ and$b$ into$((a, c), b)$ ; - consolidate
$d$ and$e$ into$(d, e)$ ; - consolidate
$f$ and$g$ into$(f, g)$ ; - consolidate
$(d, e)$ and$(f, g)$ into$((d, e), (f, g))$ ; - consolidate the final two leaf nodes,
$((a, c), b)$ and$((d, e), (f, g))$ , into the tree's final Newick representation$(((a, c), b), ((d, e), (f, g)))$ .

For unrooted trees, we may arbitrarily construct a root on any one of the tree's edges.
root picked arbitrarily at one of the internal edges. As a result, we will wind up with
different possible Newick formats. For example, the tree above tree can be
represented as