Hi,
I have to programming with java code the Insert Sort Algorithm . Every iteration of insertion sort removes an element from the input data, inserting it into the correct position in the already-sorted list, until no input elements remain.
The algoritgm put each element in a empty list , for example:
List <Object> x = new ArrayList<Object>();
Object o = new .... ;
x.insertSort(o);
ex:
x.insertSort(9);
x.insertSort(12);
x.insertSort(1);
x.insertSort(50)
x.insertSort( 0 ) ;
x.toString() > 0, 1 , 9 , 12 , 50
This operation put the object o in x by comparing y ( y attribute of o , o.y ) where y is a double.
Someone has this algorithm in java (even in pseudocode) ?
Thanks for all ! ;)
Edited by: smanuel on Jan 3, 2009 12:50 AM
Edited by: smanuel on Jan 3, 2009 1:18 AM