Class ArrayDequeExample
java.lang.Object
topics.foundation.structures.ArrayDequeExample
ArrayDeque Demonstration
Demonstrates the dual-purpose nature of the ArrayDeque data structure,
operating efficiently as both a First-In-First-Out (FIFO) queue and a
Last-In-First-Out (LIFO) stack.
Complexity
- Time Complexity: Amortized
O(1)for insertions and removals at both the head and the tail. - Space Complexity:
O(N)to store the elements, dynamically resizing as needed without the memory overhead of allocating individual node objects (unlike a linked list).
- Author:
- vicegd
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ArrayDequeExample
public ArrayDequeExample()
-
-
Method Details
-
main
Main execution entry point.- Parameters:
args- Command-line arguments (not utilized).
-