Tree Traversal in Swift using Generics

Tree traversal means visiting/accessing each node of a tree.