Priority Queues

Create a Queue that Supports Data Priority
Published

April 14, 2025

Exploration

  • Read chapter 19 in A First Course on Data Structures in Python
  • Explore PriorityQueue implementations in the ds2 package of donsheehy/datastructures. Can you write tests to confirm that they preserve priority? Can you see how this data structure combines those that we previously studied?
  • Review previous chapters to see how the data structures like List, Queue, and Tree support the behavior of this data structure.

Activities

  • Tuesday and Thursday: Priority Queues
    • Explore how to implement the PriorityQueue data structure
    • Understand how the List and Tree support implementing the PriorityQueue
    • Explore how the Heap can be used to implement the PriorityQueue
    • Examine Python source code segments to illustrate key points
  • Friday: Submit algorithm engineering project six, start algorithm engineering project seven, and prepare for the algorithm engineering skill-check next week

Project

Goal

To build and use a Python program, called treeprocessor, that runs benchmarks to study the performance of finding data values in a hierarchical data structure.

Steps

  • Click the link provided in Discord to get started on this project
  • Use Tree Processor as your template repository
  • Install the project’s dependencies using devenv and/or poetry
  • Follow the instructions to complete the project:
    • Week 1: Implement all of the modules in treeprocessor
    • Week 2: Design and conduct experiments and document experimental results
  • Schedule office hours if you have questions
Student Insights

Students who completed this project shared these insights:

  • “Creating a file traversal system highlights the intricacies of path structures and the flow of systems. It was also eye opening in terms of various permissions and error handling, as the importance of such factors impact how access to the directory is programmed. Knowing how these factors affect each other is key in figuring out how to most efficiently traverse a file system.” Chloe Bonson

  • “After completing this project, one takeaway that I had is that files can have different sizes based on the operating system. The Windows operating system files take up more space based on the average amount of bytes from processing the same folder across the three operating systems that I studied.” Luke Barker

Slides

Full Screen: Week Fourteen: Priority Queues

Back to top