The seq() method belongs to the concrete value members of the class Iterable. It is helpful in visualizing the sequential view of the stated collection. It has a time complexity of O(1).
- Method Definition:
def seq: Iterator[A]
- Return Type:
It returns a sequential view of the iterator.
3 4 5 6 7
Here, a sequential view of the stated iterator is returned by the seq method of Scala.
Here, a non-empty iterator is returned.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.