Priority Queue Data Structure in Python: Coding Tutorials by Umar Khan

Опубликовано: 15 Октябрь 2022
на канале: Coding Tutorials by Umar Khan
489
9

In this video, we'll talk about the priority queue and create one in Python. A priority queue is like a queue, but there are some differences. In a priority queue, items are inserted arbitrarily. However, items are removed from the queue not in first-in/first-out (FIFO) order, but by the priority of each item. The highest priority item is removed whenever the queue is "popped."

To conceptualize a priority queue, think of a lobby where customers take a number when they enter and then have a seat in a random chair. Where customers are located has no bearing on when they will be served. All that matters is the ticket number each customer holds; in this situation, the smallest number is the highest priority, and is associated with the next customers to be served.

The final code produced in this video is located at the link below for your reference.

Thanks for watching!

Umar
----------------------
Link to files:

https://github.com/u-khan-dev/priorit...


На этой странице сайта вы можете посмотреть видео онлайн Priority Queue Data Structure in Python: Coding Tutorials by Umar Khan длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Coding Tutorials by Umar Khan 15 Октябрь 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 489 раз и оно понравилось 9 зрителям. Приятного просмотра!