- double-linked-list gives deque its double-linked feature because DLLNode offers both prev and next - (ie. methods like get/setPrev, get/setNext) - It makes it a lot easier to implement the double-direction feature.
- offerFirst is a necessary part of the Deque interface because it allows us to insert an element at the beginning at either beginning of the Deque. We chose to write offerFirst instead of addFirst because we thought it would be useful for us to be able to check whether or not the thing we added was successful instead of having to look at the entire stack.
- offerLast is a necessary part of the Deque interface because it allows us to insert an element at either end of the Deque. We chose to write offerLast instead of addLast because we thought it would be useful for us to be able to check whether or not the thing we added was successful instead of having to look at the entire stack.
- pollFirst is a necessary part of the Deque interface because it returns the value at either front of the deque and removes it. We chose to write pollFirst over removeFirst because it can be used without having to throw an exception and instead just checks if the deque is empty.
- pollLast is a necessary part of the deque interface because it returns the value at either end of the deque and removes it. We chose to write pollLast over removeLast because it can be used without having to throw an exception and instead just checks if the deque is empty.
- peekFirst is a necessary part of the deque interface because it allows us to see what the value at either of the fronts is. We chose to write peekFirst over getFirst because it can be used without having to throw an exception and instead just checks if the deque is empty and returns null.
- peekLast is a necessary part of the deque interface because it allows us to see what the value at either ends is. We chose to write peekLast over getLast because it can be used without having to throw an exception and instead just checks if the deque is empty and returns null.
- We moved the "Why we chose DLLNode" section from the bottom to the top of the file and got rid of the problem of that part being a code block instead of formatted text. The reason why that problem occurred remains unknown. But moving it up did give back did fix the formatting issue.
- Bugs fixed! We did not include a main method in the first place and so the code didn't compile. We added a main method with some test cases and fixed a lot of bugs in our code (typos, wrong variable and method names, incompatible return types, etc.) which we didn't discover before. Now the code compiles correctly and displays the test results.
- API updated!