I do not understand the difference between LinkedList and Deque in Java
LinkedList<Integer> linkedList = new LinkedList<>();
Deque<Integer> myDeque = new LinkedList<>();
Both of these allow inserting and deleting elements from the front and the end. Both of these have methods such as addFirst, addLast and removeFirst and removeLast.
linkedList.addFirst(1);
linkedList.addLast(2);
System.out.println(linkedList);
myDeque.addFirst(1);
myDeque.addLast(2);
System.out.println(myDeque);
Also, I do not understand why LinkedList should permit inserting elements from the front, since this is a custom requirement. By the same logic, LinkedList should also have custom methods for getting the smallest and largest element?