In Scala mutable collections, toList() method is utilized to return a list consisting of all the elements of the SortedSet.
Method Definition: def toList: List[A]
Return Type: It returns a list consisting of all the elements of the SortedSet.
10 20 30 40 50
1 12 23 41 43 72
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.