Skip to content

Latest commit

 

History

History
21 lines (11 loc) · 1016 Bytes

File metadata and controls

21 lines (11 loc) · 1016 Bytes

You Don't Know Queues

But after this, you will.

In this assignment, you will engage in a test-driven development process to implement a queue, a FIFO data structure providing O(1) enqueue and dequeue operations. We'll call it a "Queue."

Run the Test Suite

python3 -m unittest test_queue

Open both test_queue.py and queue.py in your editor of choice. Modify the implementation in queue.py to pass the first test. Once it passes, create a commit. Then, uncomment the next test, and re-run the test suite. Implement what's necessary to pass the test, and then repeat this process.

But wait!

Toward the middle of the test suite, you should be thinking about the algorithmic efficiency of each operation. Are the enqueue and dequeue operations O(1)?

Best Done in Pairs!

Get together with a friend in front of just one machine, and take turns being the driver. Change drivers after each test is passed. Don't forget to commit after each test.

(c) 2019 Yong Joseph Bakos. All rights reserved.