Quicksort vs Mergesort in 35 Seconds

Sort 200 different colors in under 30 seconds #shorts Quick sort and Merge sort are used. We see that quicksort takes fewer operations here, but some of th...

Dubious Code855.6K views0:40

🔥 Related Trending Topics

LIVE TRENDS

This video may be related to current global trending topics. Click any trend to explore more videos about what's hot right now!

THIS VIDEO IS TRENDING!

This video is currently trending in Saudi Arabia under the topic 'new zealand national cricket team vs west indies cricket team match scorecard'.

About this video

Sort 200 different colors in under 30 seconds #shorts Quick sort and Merge sort are used. We see that quicksort takes fewer operations here, but some of that could be how I counted the operations. Quicksort is known for being the fastest though. Quicksort work by selecting a pivot value and putting everything less than (or equal to) that pivot to the left of it in the array, and everything greater than the pivot to the right of it. Merge sort works by recursively splitting the list until it has two lists with only one element in them, and then merging them together in the correct order. Both of these are n log n time. My quicksort implementation doesn't use extra storage, my merge sort implementation does make slices of the list when it is splitting. This was done using python & pygame All code # Copyright 2021 Google LLC # SPDX-License-Identifier: Apache-2.0 # https://www.apache.org/licenses/LICENSE-2.0 The inspiration for this code was this github repo https://github.com/LucasPilla/Sorting-Algorithms-Visualizer I used this algorithm to turn a wavelength into an RGB color http://www.noah.org/wiki/Wavelength_to_RGB_in_Python Thumbnail Background image (Thunderstorm) by FelixMittermeier https://pixabay.com/photos/thunderstorm-lightning-flashes-3625405/

Video Information

Views
855.6K

Total views since publication

Likes
36.1K

User likes and reactions

Duration
0:40

Video length

Published
Jan 31, 2021

Release date

Quality
hd

Video definition

Tags and Topics

This video is tagged with the following topics. Click any tag to explore more related content and discover similar videos:

Tags help categorize content and make it easier to find related videos. Browse our collection to discover more content in these categories.