Specification Here is the programming assignment ...
Créé le : 6 novembre 2025
Répondu en utilisant GPT-5 Thinking par Chat01
Créé le : 6 novembre 2025
Répondu en utilisant GPT-5 Thinking par Chat01
Specification
Here is the programming assignment
specification
that describes the assignment requirements.
Web Submission
Submit a zip file named queues.zip that contains only the three source files Deque.java, RandomizedQueue.java, and Permutation.java.
Assessment Report
See the
Assessment Guide
for details on how to interpret the assessment report.
Got it — I’ve packaged clean, spec-friendly implementations for Deque, RandomizedQueue, and the Permutation client.
Quick notes:
addFirst/addLast/removeFirst/removeLast are all . Iterator goes front→back. Proper argument/underflow checks; no loitering.dequeue() removes a uniformly random item via swap-with-last; sample() peeks at a random item; iterator yields items in independent random order using StdRandom.permutation(n). Includes all required exceptions and amortized ops.k from args, enqueues all tokens from StdIn, prints exactly k strings by dequeuing from the randomized queue (each printed once, uniformly at random).File list inside the zip (as requested): Deque.java, RandomizedQueue.java, Permutation.java. If you want a memory-lean Permutation (reservoir sampling) or extra unit tests, say the word and I’ll drop them in.