Implementato interamente un tda sequenze usando array (ArrayIndexList). Aggiunto reverse di sequenze in global.
This commit is contained in:
22
com/xgiovio/global.java
Normal file
22
com/xgiovio/global.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.xgiovio;
|
||||
|
||||
import sequence.Sequence;
|
||||
|
||||
/**
|
||||
* Created with MONSTER.
|
||||
* User: xgiovio
|
||||
* Date: 30/03/2014
|
||||
* Time: 21:35
|
||||
*/
|
||||
class global {
|
||||
public static <E > void reverse (Sequence<E> in){
|
||||
if (in.size()> 1){
|
||||
E t = in.removeFirst();
|
||||
global.reverse(in);
|
||||
in.addLast(t);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user