def get_bottomup_nodes(tree, parameters=None):
    """
    Gets the nodes of a tree in a bottomup order (leafs come first, the master node comes after)

    Parameters
    --------------
    tree
        Process tree
    parameters
        Parameters of the algorithm

    Returns
    -------------
    bottomup_nodes
        Nodes of the tree in a bottomup order
    """
    if parameters is None:
        parameters = {}

    to_visit = [tree]
    all_nodes = set()
    while len(to_visit) > 0:
        n = to_visit.pop(0)
        all_nodes.add(n)
        for child in n.children:
            to_visit.append(child)
    # starts to visit the tree from the leafs
    bottomup = [x for x in all_nodes if len(x.children) == 0]
    # then add iteratively the parent
    i = 0
    while i < len(bottomup):
        parent = bottomup[i].parent
        if parent is not None and parent not in bottomup:
            is_ok = True
            for child in parent.children:
                if not child in bottomup:
                    is_ok = False
                    break
            if is_ok:
                bottomup.append(parent)
        i = i + 1

    return bottomup