import java.util.*; public class LinkedListUsage { public static final int SIZE = 16; public static final int RANGE = 8 * SIZE; static void print(LinkedList list){ Iterator it = list.iterator(); // Print list while(it.hasNext()) { System.out.print(it.next()+" "); } System.out.println(); } public static void main(String[] args) { Random rand = new Random( new Date().getTime()); LinkedList list = new LinkedList<>(); for(int i=0; i it = list.iterator(); while(it.hasNext()) { int value = it.next(); //System.out.println("value: "+value); if(value < RANGE/2) { //System.out.println("RMV: "+value); it.remove(); } } print(list); } }