How can I sort a region in an array in Scala?
I have an array, say var DivA = new Array[Int](100005).
I filled the elements in DivA up to some position which is less than 100005.
For example my array looks like Diva = {1,2,10,5,15,20}.
In C++ we have sort(DivA, DivA + N), but how can we sort arrays in Scala up to a certain index?
I tried Sorting.quickSort(DivA), but I don't know how to define the index up to which I want to sort the array, so that the statement above sorts the array, and the array looks like DivA={0,0,0,0,0}?
var Diva=new Array[Int](10000);
for(j<-15 to 0 by -1){
DivA(posA)=j;
posA=posA+1;
}
Sorting.quickSort(DivA);
for(j<-0 to posA-1)
{
print(DivA(j));
print(" ");
}