'Add a subtree starting with node n.
returns: last node added'

def addTree(self, depth, fanout):

    isSwitch = (depth > 0)
    if isSwitch:
        node = self.addSwitch(('s%s' % self.switchNum))
        self.switchNum += 1
        for _ in range(fanout):
            child = self.addTree((depth - 1), fanout)
            self.addLink(node, child)
    else:
        node = self.addHost(('h%s' % self.hostNum))
        self.hostNum += 1
    return node
