Python Sorting Algorithm Visualizer Tutorial

preview_player
Показать описание
Welcome back to another video! In todays video I'm going to be showing you to create a sorting algorithm visualizer in Python using Pygame! I have a quick demo that you can see and I will also talk about some of the prerequisites as this is not a beginner tutorial. I hope that you enjoy!

📄 Resources 📄

⭐️ Timestamps ⭐️
00:00:00 | Overview
00:00:27 | Project Demo
00:01:49 | Prerequisites
00:02:46 | Pygame Setup
00:03:35 | DrawInformation Class
00:15:15 | Generating Starting List
00:16:50 | Pygame Event Loop
00:23:00 | Drawing On The Screen
00:34:03 | Sorting Controls
00:45:06 | Implementing Bubble Sort
01:05:10 | Cosmetic Additions
01:08:48 | Implementing Insertion Sort
01:14:54 | Conclusion

◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️

◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️

⭐️ Tags ⭐️
-Tech With Tim
-Sorting Algorithm
-Python
-Visualizer

⭐️ Hashtags ⭐️
#TechWithTim #Python #Visualizer
Рекомендации по теме
Комментарии
Автор

ah I just learned insertion and bubble sort from my school. The timing couldn't have been better as I really wanna implement it eeek..TYSM!!!

farhanahmedfahim
Автор

i love how you keep explanations at a high enough level where it heavily encourages learning, while at the same time endorsing good coding practice and explaining basics. great video!

meercat
Автор

I was thinking about coading this . Tim is a mind reader

captainplanet
Автор

I'm working on a side project which has nothing to do with this. I was just watching this video pretty much randomly. But it gave me an idea and I learned a few things. Thanks a lot.

suleymantolgaacar
Автор

Brother I'm super impressed by you! Always love to see people my age doing big things; plus you've been a huge help to me and my most insufferable imposter syndrome lol. Keep up the good work!

odec
Автор

How can anyone be so awesome! I would seriously be lost without TechWithTim.

alexkerasidis
Автор

One important change that I made was to implement a draw_sort fuction that uses the generator for the sorting algorithm. This way, my algorithms are kept in separate modules for reuse.

agentm
Автор

solution for 1:04:15 in line 39: instead of math.floor,
you can use:
int()
which will automaticly remove everything behind the dot of the float

fumano
Автор

Pls do more Algorithm Visualizer Tutorial

juanrodriguez-myxc
Автор

Love this! May I suggest a class for each value being sorted. Calc the height once and store it in the value class. From that point on the draw of the value can be done using values calculated the first time. Should massively speed up the draw process. Also the value class should draw itself.

jwcolby
Автор

Very cool! Can someone explain how to implement the sound while it's sorting? Like one of those sorting videos.

Adam-gwjt
Автор

Instead of the draw function and the draw list func, you should use them as methods to your drawinfo object

AriehAnkri
Автор

hey, is anyone getting an bug where all the blocks are sqaushed towards one side?
ps. i have coded till 33:46, but i am not getting the same o/p as tim. instead of all the blocks being shuffled in the centre of the window, i am getting very few blocks (to be eaxct, 5 blocks), and they are squashed towards the left end

any way to solve this ? because i have gone through the code again and again, but cant find what i have done wrong
thanks :D

aadityasahoo
Автор

Amazing video. Should be interesting to see if I can implement different algo’s the using yield the right way, thanks again!

Nerdimo
Автор

This is brilliant. Thank you so much Tim!

Banta
Автор

hello Tim!
i will be more than Happy to see pandas tutorial videos from you..!
🤍 from Myanmar...

ihateorangecat
Автор

Tim, I just got conFronted with an ad at the beginning of your video. An AlgoExpert ad "So you want to be a Frontend engineer?" I didn't know Algoexpert was so immature until just now. Are you aware of this ad? Can't wait to see the Backend engineer version. 😬

dookshi
Автор

I suggest that in the future you build the display, JUST the display. Get it compiling and displaying, then move on to the arrays etc etc. As we say in software development, compile early and often. By the time you actually tried to run this thing I had a half dozen spelling, letter case, indentation etc problems which I had not found, and you did not have. Making matters worse, in order to look at your code, unlike in my code editor where I can slide up and down, in your video I have to move back and forth in the timeline, hoping to catch the code I want to see. I have spent the entire evening struggling to find and fix stuff that you had no problem with.

jwcolby
Автор

is there a reason you didn’t make the functions which take in “draw_info” methods of the “draw_info” class?

raphaelramesar
Автор

your tutorial is very exciting, Can you build many app such as CRUD App on python, and django ?. Question 2: Can you make a game Mario tutorial by python ?

ANNGUYEN-cwlw
visit shbcf.ru