S
Sanny
I have an array of int.
It is already sorted.
int[] car = new int[100];
Now I sort it.
After sorting The Value of 1st element is changed array So I need to
sort it again.
I find using binarydearch the position "pos" where the ist elewment
need to go.
Then I do arraycopy to shift all elements by 1 and copy the 1st
element to the "pos" position.
This terchnique takes lots of time.
I want to use linkedlist.
But when I use LinkedList car = new LinkedList();
To access ith element I use
int ii=car.get(i); It gives error saying says Object cannot be copied
to int. How to know the value of ith element in LinkedList.
And Is there an efficient way.
And which Sort is the best for sorting 40 random numbers out of
QuckSort/ MergeSort and Bubble Sort?
Bye
Sanny
It is already sorted.
int[] car = new int[100];
Now I sort it.
After sorting The Value of 1st element is changed array So I need to
sort it again.
I find using binarydearch the position "pos" where the ist elewment
need to go.
Then I do arraycopy to shift all elements by 1 and copy the 1st
element to the "pos" position.
This terchnique takes lots of time.
I want to use linkedlist.
But when I use LinkedList car = new LinkedList();
To access ith element I use
int ii=car.get(i); It gives error saying says Object cannot be copied
to int. How to know the value of ith element in LinkedList.
And Is there an efficient way.
And which Sort is the best for sorting 40 random numbers out of
QuckSort/ MergeSort and Bubble Sort?
Bye
Sanny