eu to tentando retornar o elemento central de uma lista duplamente ligada, só q fica dando erro alguem me ajuda ou tem uma solução?
public int retornaCentral(){
Node aux = inicio;
int x=0;
double i=size%2;
if(i==0)
i=size/2;
else
i= (0.5+(size/2));
while(aux.retornaNext()!=null){
x+=1;
if(x==i){
x=aux.numeros;
break;
}
else
aux=aux.retornaNext();
}
return aux.numeros;
}
}