CIND830, Module 11 - Queues

pdf

School

Toronto Metropolitan University *

*We aren’t endorsed by this school

Course

830

Subject

Computer Science

Date

Jan 9, 2024

Type

pdf

Pages

4

Uploaded by SargentHyena3676

Report
3/28/22, 5:20 PM CIND830, Module 11 - Queues https://de.ryerson.ca/de_courses/templates/m/?c=70162FE655EC381AC6312EBF026AAC54&m=11&p=206173 1/4 Introduction This module introduces two types of linear collections: stacks and queues, and their operations. It covers the implementation of these collections using a concrete data type, that is, the array data structure. The module differentiates between the stacks and queues data structures and explores the architecture, interface, and operations of each type of linear collection. The module demonstrates how to use stacks and queues in solving computing problems, such as evaluating arithmetic expressions and round-robin CPU scheduling. Topics and Learning Objectives Topics Stacks Queues Learning Objectives By the end of the module, you will be able to: Explain how a stack can be implemented in Python programs. Describe how items are added/removed to/from a queue. Differentiate between the operations used in stacks data structures and those used in queues data structures. Apply stacks and queues to solve computing problems. Readings Required Readings Lambert, K. A. (2019). Fundamentals of Python: Data structures (2 ed.). Boston, MA: Cengage Learning. Stacks, pages 167–187 Queues, pages 205–218 Stacks Please watch this video presentation as it highlights the architecture of the stacks linear collection. It shows how to implement this type of collection by exploring the employed interface of the stacks and explaining each component's functionality, from initializing an empty stack, inserting an element, and removing an element, to reaching a complete stack. The video closes with an application to show how developers apply stacks in evaluating arithmetic expressions. Download Download the PDF file for CIND830 - Module 11: Linear Collections: Stack and Queues . Please note this PDF file will be used in the two videos of this module. In the PDF, you can use the top navigation bar to navigate between the topics covered in each video. nd Ryecast Video: CIND830 - Module 11: Linear Collections - Stacks
3/28/22, 5:20 PM CIND830, Module 11 - Queues https://de.ryerson.ca/de_courses/templates/m/?c=70162FE655EC381AC6312EBF026AAC54&m=11&p=206173 2/4 Download the CIND830 - Module 11: Linear Collection - Stacks transcript . Examples of Stack Implementations in Python In this video, we compare three different ways of implementing the stack data structure in Python. Then, we solve a simple problem: checking if a string is palindrome using stacks. Download Download the CIND830 - Module 11: Stack Implementations in Python transcript . Queues Please watch this video presentation as it walks you through the second topic in this module: Queues. We will learn the architecture of these linear collections and how it differs from the stacks’ architecture. We will then explore the queues interface components to understand how to implement and apply these components based on the problem requirements. Developers use the queues interface components to manipulate the data elements of the queues. We will also introduce the priority queues data structures, which are special types of regular queues. Finally, we will close the lecture by introducing a queues application that employs the time-sharing notion in a cyclic manner. Download Download the PDF file for CIND830 - Module 11: Linear Collections: Stack and Queues and click on the topic “ Queues ” in the top navigation bar to take you to the beginning of this topic. Download the CIND830 - Module 11: Linear Collections: Queues transcript . Examples of Queue Implementations in Python In this video, we compare three different ways of implementing the queue data structure in Python. Then, we create a supermarket simulator using queues to emulate checkout lines. Download Download the CIND830 - Module 11: Queue Implementations in Python transcript . Ryecast Video: CIND830 - Module 11: Stack Implementations in Python Ryecast Video: CIND830 - Module 11: Linear Collections: Queues Ryecast Video: CIND830 - Module 11: Queue Implementations in Python
3/28/22, 5:20 PM CIND830, Module 11 - Queues https://de.ryerson.ca/de_courses/templates/m/?c=70162FE655EC381AC6312EBF026AAC54&m=11&p=206173 3/4 Self-Assessment Quiz Please complete the following review activity. The activity is not graded. Test Yourself Summary In this module, we learned about the architecture of the stacks and queues linear collections, and how to implement them using the array class that has been defined in an earlier module. We also learned how stacks and queues could be employed to solve computing problems such as evaluating arithmetic expressions and scheduling real-time processes. Activities Discussion Module 11 Discussion This week, let’s discuss implementations of stacks and queues linear collections in the Module 11 Discussion topic in D2L under the Communication drop-down menu, then Discussions . Feel free to start a new thread or respond to someone else’s post. Lab Activity Lab 9 Before starting Lab 9, be sure you have reviewed all the content in Module 11. The lab is a practical extension to apply your knowledge gained from this module. Download Lab 9 now and complete it by the end of this week. Your instructor will give you time to work on it before releasing the solutions in a folder called Lab Solutions in D2L under the Course Materials drop-down menu for you to verify your answers. The lab activity is not graded. While working on your lab, post any questions, ideas, and strategies in the Module 11 Discussion topic in D2L. Feel free to read and respond to your peers’ posts as well. You may also have the option of reaching out to your instructor during his/her virtual office hours. Please note: The PDF for the lab activity may not be fully accessible for students who use assistive technology. If you require an accessible version, please contact your instructor. Assessments Quiz 9 Please go to your D2L course shell, under the Assessment drop-down menu, select Quizzes . Then click on the Quiz 9 link and follow the instructions to complete this quiz. The date and length of time have been set for this quiz. This quiz is a cumulative 10% of your final grade. Reminder Continue working on Assignment 3 (worth 10% of your final grade) , due by the end of Module 12.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
3/28/22, 5:20 PM CIND830, Module 11 - Queues https://de.ryerson.ca/de_courses/templates/m/?c=70162FE655EC381AC6312EBF026AAC54&m=11&p=206173 4/4 While you are working on this assignment, feel free to share your questions, ideas and strategies in the Assignment 3 Discussion topic in D2L. References Lambert, K. A. (2019). Fundamentals of Python: Data structures (2 ed.). Boston, MA: Cengage Learning. Python Software Foundation. (2020). Python 3.7.8 documentation . Retrieved from https://docs.python.org/3.7/index.html. nd