def graph_labeling_to_list(t, keys):
    """Creates a list that contains the tree's labels (according to the pre-order traversal).

    Args:
        t:      a dictionary that contains the nodes of a labeled tree
        keys:   sorted keys of the given t

    Returns:
        list:   contains the tree's labels
    """

    label_list = []
    for i in keys:
        label_list.append(t[i].label)
    return tuple(label_list)