filmov
tv
Queue | Collections | More Simple Python Tutorials | 2021

Показать описание
This python tutorial for beginners explains how to use the deque module from collections in python. The video shows how to create a queue using the deque module, how to add elements using append and extend, and also how to remove elements using the pop and popleft functions.
In python we can create a queue using a list but when you remove the first element the other elements have to move up one place which is inefficient. So, there is a function that allows for removal at the beginning of a list called deque which stands for double ended queue.
A queue is a data structure in python that adds elements at the end and uses the queuing system where the first item is removed in a ‘first in, first out (FIFO)’ approach. To understand this, we compare the queue data structure with the stack which uses the las in first out approach.
With an example using breadth-first search and depth-first search we can see how to implement these algorithms using either a queue or a stack.
We compare using a normal python list and the deque and see that there is a huge difference in efficiency when removing the first element. We complete the video with a challenge spread over 5 parts, and the solution is also explained. Enjoy!
0:00 video start
0:35 what is a queue
2:04 deque code
2:43 online help
4:39 online demo
5:31 why use a queue
7:20 breadth-first search
8:17 depth-first search
8:42 list vs deque
13:29 practice exercises
14:34 practice solutions
#pythontutorialsforbeginners #pythonfundamentals #pythontutorials
PYTHON PLAYLISTS ON YOUTUBE:
Python Coder – Beginner
Python Fun & Games
More Simple Python Tutorials
Simple Python
Python Regular Expressions
WHY LEARN CODING WITH DR CODIE:
If you want to know how to learn python then these python programming tutorials are for you. Hi, my name is Dr Codie and I have helped many students to learn python, Scratch, SQL and other programming languages. In these videos you see how to learn python using your existing knowledge and gain some tips for learning python. Codie means ‘helpful person’ and we want to help you not just learn python programming but to enjoy learning python. We start with python tutorials for beginners and then move to tutorials for more advanced learning. The videos teach python 3.
In my experience, success being a python coder comes down to getting the fundamentals right. You can then move onto advanced programming concepts and skills. You will understand how to do simple coding tasks and then we will show you the simple methods of putting lines or blocks of code together using this knowledge. Practice is essential for your skills to grow but again do not fear we will help you practice as well.
Learn to understand the logic and design aspects needed to become a good programmer, let us help you practice to keep improving and don’t forget the bonus of seeing first hand how to build the code and possible stumbling blocks when we explain the answers to the tasks set within the tutorial. You do not need to watch the whole video but if you do you will improve as a python coder!
SOCIAL MEDIA
SUBSCRIBE and you will know when the videos are available! Good luck!
In python we can create a queue using a list but when you remove the first element the other elements have to move up one place which is inefficient. So, there is a function that allows for removal at the beginning of a list called deque which stands for double ended queue.
A queue is a data structure in python that adds elements at the end and uses the queuing system where the first item is removed in a ‘first in, first out (FIFO)’ approach. To understand this, we compare the queue data structure with the stack which uses the las in first out approach.
With an example using breadth-first search and depth-first search we can see how to implement these algorithms using either a queue or a stack.
We compare using a normal python list and the deque and see that there is a huge difference in efficiency when removing the first element. We complete the video with a challenge spread over 5 parts, and the solution is also explained. Enjoy!
0:00 video start
0:35 what is a queue
2:04 deque code
2:43 online help
4:39 online demo
5:31 why use a queue
7:20 breadth-first search
8:17 depth-first search
8:42 list vs deque
13:29 practice exercises
14:34 practice solutions
#pythontutorialsforbeginners #pythonfundamentals #pythontutorials
PYTHON PLAYLISTS ON YOUTUBE:
Python Coder – Beginner
Python Fun & Games
More Simple Python Tutorials
Simple Python
Python Regular Expressions
WHY LEARN CODING WITH DR CODIE:
If you want to know how to learn python then these python programming tutorials are for you. Hi, my name is Dr Codie and I have helped many students to learn python, Scratch, SQL and other programming languages. In these videos you see how to learn python using your existing knowledge and gain some tips for learning python. Codie means ‘helpful person’ and we want to help you not just learn python programming but to enjoy learning python. We start with python tutorials for beginners and then move to tutorials for more advanced learning. The videos teach python 3.
In my experience, success being a python coder comes down to getting the fundamentals right. You can then move onto advanced programming concepts and skills. You will understand how to do simple coding tasks and then we will show you the simple methods of putting lines or blocks of code together using this knowledge. Practice is essential for your skills to grow but again do not fear we will help you practice as well.
Learn to understand the logic and design aspects needed to become a good programmer, let us help you practice to keep improving and don’t forget the bonus of seeing first hand how to build the code and possible stumbling blocks when we explain the answers to the tasks set within the tutorial. You do not need to watch the whole video but if you do you will improve as a python coder!
SOCIAL MEDIA
SUBSCRIBE and you will know when the videos are available! Good luck!
Комментарии