public static void removeEvensVer1( List<Integer> lst )
{
int i = 0;
while( i < lst.size( ) )
if( lst.get( i ) % 2 == 0 )
lst.remove( i );
else
i++;
}
According to my understanding, shouldn't this method be N^3? Since you have a while loop (N) * lst.get(i) which is another N provided lst is a LinkedList, and finally remove which is also N.