O'Reilly logo

Swift Functional Programming - Second Edition by Dr. Fatih Nayebi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Trees

In computer science, a Tree is a very popular abstract data type (ADT) or a data structure implementing this ADT that simulates a hierarchical Tree structure with a root value and subtrees of the children with a parent node, represented as a set of linked nodes.

A Tree data structure can be defined recursively (locally) as a collection of nodes (starting at a root node), where each node is a data structure consisting of a value, together with a list of references to nodes (the children) with the constraints that no reference is duplicated and none point to the root.

Alternatively, a Tree can be defined abstractly as a whole (globally) as an ordered Tree, with a value assigned to each node. Both these perspectives are useful: while a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required