intersection method

List<Node<T>> intersection(
  1. List<Node<T>> other
)

Implementation

List<Node<T>> intersection(List<Node<T>> other) {
  if (identical(this, other)) return toList();
  if (isEmpty || other.isEmpty) return [];

  var intersection = where((e) => other.contains(e)).toList();
  return intersection;
}