can I cut (delete) a portion from a Linked List by index? For example, if the input is "100", I want to delete the first 100 elements from a linked list. Currently, my code deletes them one by one.
public void remove(LinkedList<String> queue, int count){
if (count > queue.size()) {
System.out.println(ERROR);
return;
}
for (int i = 0; i < count; i++) {
queue.remove(0);
}
}