sortedByOutputsDepth method

List<Node<T>> sortedByOutputsDepth({
  1. bool bfs = false,
})

Implementation

List<Node<T>> sortedByOutputsDepth({bool bfs = false}) {
  var nodesOutputs = outputsInDepth(bfs: bfs);

  var entries = nodesOutputs.entries.toList();

  entries.sort((a, b) => a.value.length.compareTo(b.value.length));

  var nodes = entries.keys.toList();
  return nodes;
}