In Java I can write
private final List<Point> points = ...;
...
Collections.sort(points.subList(start, end), sorter);
(This is used as part of an algorithm that sorts the entire List in a particular way.)
I'd like to be able to express the equivalent in Scala with Array. I have tried this:
val a = Array("z", "y", "x", "w", "v")
val b = a.slice(1, 4)
Sorting.quickSort(b)
But unfortunately it doesn't work as the slice copies a. How can I sort part of an array in Scala?
Edit: the intention is that sorter becomes a Scala Ordering.