package dataStructures; import java.util.*; /** *

Titulo: Uma implementaçao vectorial do Conjunto

*

Descrição: Esta implementaçao usa uma representação estática crescente * para guardar a informaçao

* @version 1.0 */ public class VSet implements Set,Cloneable { private final int DELTA = 128; private int nElems; private Object[] theSet; public VSet() { theSet = new Object[DELTA]; nElems = 0; } public Set empty() { return new VSet(); } public boolean isEmpty() { return nElems == 0; } public int length() { return nElems; } /** * Increments the structure length (adds 'DELTA' new slots) */ private void grow() { Object[] newSet = new Object[theSet.length + DELTA]; for(int i=0;i= 0) for (int i=nextElem; i