S
Sanny
Arrays.sort uses the fastest way to sort the array.
But say I have a Array of lebgth 200. And I only want to sort first
20 / 30 elements can I tell that it has to sort only forst 30
elements?
And Say I have an Array
int[] cars=new int[200];
And it has a few random values.
I also have Other Array carname[]
String[] carname = new String[200];
What I want is when Array cars is Sorted the other Array carname is
also sorted.
Say cars[5]; is highest value and is at Top position then I want
carname[5] String also to be sorted to first place.
If I use Arrays.sort(cars) How will I update the corresponding Array
carsname[] So that both are Sorted Simultaniously
And will using Arrays.sort faster than using seperate function using
MergeSort/ Quick Sort.
And The Old Question Say cars[1] value has changed now I want to
insert it into the Array at a position where the Array is fully
Sorted. Currently I am using ArrayCopy to shift all elements and doing
binary search on the sorted Array cars to know the position where the
cars[1] Value should be shifted after it changes.
Is there any inbuilt routines for these work. Last Time I asked this
question. People talked about Linked List and I get errors using JDK
1.3 using linkedlist
List<Integer> cars = new LinkedList<Integer>();
I am getting Compilation error "value needed" May be I need JDK 1.5
for using above code and is not supported in JDK 1.3?
Bye
Sanny
But say I have a Array of lebgth 200. And I only want to sort first
20 / 30 elements can I tell that it has to sort only forst 30
elements?
And Say I have an Array
int[] cars=new int[200];
And it has a few random values.
I also have Other Array carname[]
String[] carname = new String[200];
What I want is when Array cars is Sorted the other Array carname is
also sorted.
Say cars[5]; is highest value and is at Top position then I want
carname[5] String also to be sorted to first place.
If I use Arrays.sort(cars) How will I update the corresponding Array
carsname[] So that both are Sorted Simultaniously
And will using Arrays.sort faster than using seperate function using
MergeSort/ Quick Sort.
And The Old Question Say cars[1] value has changed now I want to
insert it into the Array at a position where the Array is fully
Sorted. Currently I am using ArrayCopy to shift all elements and doing
binary search on the sorted Array cars to know the position where the
cars[1] Value should be shifted after it changes.
Is there any inbuilt routines for these work. Last Time I asked this
question. People talked about Linked List and I get errors using JDK
1.3 using linkedlist
List<Integer> cars = new LinkedList<Integer>();
I am getting Compilation error "value needed" May be I need JDK 1.5
for using above code and is not supported in JDK 1.3?
Bye
Sanny