This is a part of a full algorithm series - Check it out here:
[ Ссылка ]
Kite helps fund the channel, thanks for checking them out and supporting me --
⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. [ Ссылка ]
#Python #QuickSort #Algorithm
In this one we're covering the quick sort algorithm! One of the favorite sorting algorithms due to its speed in an average case.
The Quick Sort algorithm takes an item from the unsorted list and uses it as the 'pivot' or the item to compare the remainder of the items in the list. We do comparisons placing the items in lists according to if they are larger or smaller than the pivot value.
We repeat this process creating smaller and smaller lists until we have list values of one which have been sorted.
Join The Socials -- Picking Shoutouts Across YouTube, Insta, FB, and Twitter!
FB - [ Ссылка ]
Insta - [ Ссылка ]
Twitter - [ Ссылка ]
LinkedIn - [ Ссылка ]
GitHub - [ Ссылка ]
Thanks so much for the continued support of the channel! You guys are awesome and I'm very thankful to be at this point. 5,500+ subscribers at the time of writing. Thank you all so much!
*****************************************************************
Full code from the video:
def quick_sort(sequence):
length = len(sequence)
if length #less than= 1:
return sequence
else:
pivot = sequence.pop()
items_greater = []
items_lower = []
for item in sequence:
if item #greater than pivot:
items_greater.append(item)
else:
items_lower.append(item)
return quick_sort(items_lower) + [pivot] + quick_sort(items_greater)
print(quick_sort([5,6,7,8,9,8,7,6,5,6,7,8,9,0]))
#Youtube Doesn't allow angled brackets - Sorry about that!
[ Ссылка ]
Packages (& Versions) used in this video:
Python 3.7
Atom Text Editor
*****************************************************************
Code from this tutorial and all my others can be found on my GitHub:
[ Ссылка ]
Check out my website:
[ Ссылка ]
If you liked the video - please hit the like button. It means more than you know. Thanks for watching and thank you for all your support!!
--- Channel FAQ --
What text editor do you use?
Atom - [ Ссылка ]
What Equipment do you use to film videos?
[ Ссылка ]
What editing software do you use?
Adobe CC - [ Ссылка ]
Premiere Pro for video editing
Photoshop for images
After Effects for animations
Do I have any courses available?
Yes & always working on more!
[ Ссылка ]
Where do I get my music?
I get all my music from the copyright free Youtube audio library
[ Ссылка ]
Let me know if there's anything else you want answered!
-------------------------
Always looking for suggestions on what video to make next -- leave me a comment with your project! Happy Coding!
Ещё видео!