         node.parent = self
     }
     
-    /**
-     Remove the given `node` from `children`.
-     
-     - throws: `MutableTreeError.removalError` if the given `node` is not held in `children`.
-     */
+    /// Remove the given `node` from `children`.
+    ///
+    /// - throws: `MutableTreeError.removalError` if the given `node` is not held in `children`.
     func removeChild(_ node: Self) throws {
         
         guard let index = children.index(where: { $0 === node }) else {

    
    /// Height of node.
    var height: Int {
        return descendToGetHeight(of: self, result: 0)
    }
    
    fileprivate func descendToGetHeight(of node: Self, result: Int) -> Int {
        
        if node.isLeaf {
            return result
        }
        
        return node.children
            .map { descendToGetHeight(of: $0, result: result + 1) }
            .reduce(0, max)
    }
    
    /// Height of containing tree.
    var heightOfTree: Int {
        return root.height
    }
    
    /// Depth of node.
    public var depth: Int {
        return ascendToGetDepth(of: self, depth: 0)
    }
    
    fileprivate func ascendToGetDepth(of node: Self, depth: Int) -> Int {
        guard let parent = node.parent else { return depth }
        return ascendToGetDepth(of: parent, depth: depth + 1)
    }
}

    
    /// - returns: `true` if there is no parent. Otherwise, `false`.
    var root: Self {
        
        func ascendToGetRoot(of node: Self) -> Self {
            
            guard let parent = node.parent else {
                return node
            }
            
            return ascendToGetRoot(of: parent)
        }
        
        return ascendToGetRoot(of: self)
    }
    
