WEBVTT
Kind: captions
Language: en

00:00:00.000 --> 00:00:02.460
sorting algorithms are step-by-step procedures&nbsp;&nbsp;

00:00:02.460 --> 00:00:05.640
used to arrange a collection of&nbsp;
items or data in a particular order

00:00:07.860 --> 00:00:12.180
they take a disorganized list of elements&nbsp;
and rearrange them based on a standard such&nbsp;&nbsp;

00:00:12.180 --> 00:00:16.440
as numerical or alphabetical order these&nbsp;
algorithms are valuable Tools in computer&nbsp;&nbsp;

00:00:16.440 --> 00:00:21.180
science as they make it easier to organize&nbsp;
analyze and search information there are&nbsp;&nbsp;

00:00:21.180 --> 00:00:26.100
numerous approaches to organizing an unordered&nbsp;
list resulting in the development of multiple&nbsp;&nbsp;

00:00:26.100 --> 00:00:30.720
sorting algorithms each with its own level&nbsp;
of efficiency when measuring an algorithm's&nbsp;&nbsp;

00:00:30.720 --> 00:00:34.920
performance we typically look at its time&nbsp;
complexity which refers to how fast the&nbsp;&nbsp;

00:00:34.920 --> 00:00:40.380
algorithm is time complexity helps us understand&nbsp;
how the algorithm's efficiency scales with larger&nbsp;&nbsp;

00:00:40.380 --> 00:00:45.420
inputs and we use a mathematical notation called&nbsp;
Big O notation to express this time complexity&nbsp;&nbsp;

00:00:45.420 --> 00:00:50.580
some commonly known sorting algorithms include&nbsp;
merge sort quicksort and insertion sort in this&nbsp;&nbsp;

00:00:50.580 --> 00:00:55.380
video instead of reviewing these typical and&nbsp;
useful sorting algorithms we will explore the&nbsp;&nbsp;

00:00:55.380 --> 00:01:00.300
realm of Impractical sorting algorithms that&nbsp;
I personally find nonsensical and downright&nbsp;&nbsp;

00:01:00.300 --> 00:01:04.800
hilarious these algorithms are meant to serve&nbsp;
as jokes or without experiments to highlight&nbsp;&nbsp;

00:01:04.800 --> 00:01:09.780
the inefficiency or impracticality of certain&nbsp;
approaches sorting but before we dive in let&nbsp;&nbsp;

00:01:09.780 --> 00:01:14.040
me tell you about today's sponsor flexispot I&nbsp;
had a great opportunity to receive and discuss&nbsp;&nbsp;

00:01:14.040 --> 00:01:18.720
one of their amazing products the flexispot&nbsp;
E7 standing desk I've never had or used a&nbsp;&nbsp;

00:01:18.720 --> 00:01:22.920
standing desk before but then I realized it'd&nbsp;
be really nice to have one once I discovered&nbsp;&nbsp;

00:01:22.920 --> 00:01:27.420
their benefits they can seriously improve your&nbsp;
posture boost your ability to focus and are just&nbsp;&nbsp;

00:01:27.420 --> 00:01:31.680
better for your health overall let's take a&nbsp;
look at the E7 but first we need to build it

00:01:36.360 --> 00:01:41.520
let's kick things off with the E7 most prominent&nbsp;
feature its adjustable height functionality this&nbsp;&nbsp;

00:01:41.520 --> 00:01:45.660
feature allows for seamless and quiet height&nbsp;
adjustments enabling you to find that perfect&nbsp;&nbsp;

00:01:45.660 --> 00:01:50.400
sweet spot for both comfort and productivity&nbsp;
but it's not just about flexibility this thing&nbsp;&nbsp;

00:01:50.400 --> 00:01:55.800
is built to last it is very durable and sturdy&nbsp;
it's made with a thick carbon steel frame making&nbsp;&nbsp;

00:01:55.800 --> 00:01:59.940
it incredibly stable so you won't experience&nbsp;
any annoying wobbles while you're working or&nbsp;&nbsp;

00:01:59.940 --> 00:02:03.840
gaming your life away the E7 also has&nbsp;
an impressive weight capacity of up to&nbsp;&nbsp;

00:02:03.840 --> 00:02:08.640
355 pounds so you can confidently place all&nbsp;
of your equipment and devices on top of the&nbsp;&nbsp;

00:02:08.640 --> 00:02:12.300
desk without worrying about damaging it oh&nbsp;
did I also mention that it's built with its&nbsp;&nbsp;

00:02:12.300 --> 00:02:16.920
own Cable Management tray a USB port on the&nbsp;
side of the keypad to charge your devices and&nbsp;&nbsp;

00:02:16.920 --> 00:02:20.160
a collision detection system so that your&nbsp;
stuff won't get crushed like a submarine&nbsp;&nbsp;

00:02:20.820 --> 00:02:25.440
like honestly this thing is a beast so if you're&nbsp;
looking for a comfortable and adjustable workspace&nbsp;&nbsp;

00:02:25.440 --> 00:02:29.580
I highly recommend this standing desk it's a&nbsp;
great value for the price and it's made with high&nbsp;&nbsp;

00:02:29.580 --> 00:02:34.620
quality materials elevate your productivity and&nbsp;
well-being with the flexi spot E7 standing desk&nbsp;&nbsp;

00:02:34.620 --> 00:02:40.080
your body will thank you thank you to flexispot&nbsp;
for sponsoring this video now back to the video&nbsp;&nbsp;

00:02:40.080 --> 00:02:46.260
starting at number one we have Stalin sort Stalin&nbsp;
sort is an algorithm that takes inspiration from&nbsp;&nbsp;

00:02:46.260 --> 00:02:51.060
the way godo Joseph Stalin ran things in the&nbsp;
Soviet Union when people dared to act out of&nbsp;&nbsp;

00:02:51.060 --> 00:02:55.620
order when you apply Stalin sort to a list it&nbsp;
goes through each element from left to right&nbsp;&nbsp;

00:02:55.620 --> 00:03:00.600
and if it spots any element that's out of order&nbsp;
it gets deleted and sent to the gulag if we apply&nbsp;&nbsp;

00:03:00.600 --> 00:03:05.160
Stalin sort to this list it removes elements 15&nbsp;
and 5 since they are smaller than the previous&nbsp;&nbsp;

00:03:05.160 --> 00:03:09.960
element encountered now the resulting list only&nbsp;
contains the elements that are in ascending order&nbsp;&nbsp;

00:03:09.960 --> 00:03:15.900
what's funny about this algorithm is that it's&nbsp;
guaranteed to work after only one iteration but&nbsp;&nbsp;

00:03:15.900 --> 00:03:21.540
at the expense of losing some data number two&nbsp;
sleep sort sleep sort is a Time based algorithm&nbsp;&nbsp;

00:03:21.540 --> 00:03:26.160
where each element in the array is given its&nbsp;
own special thread and each thread slips for a&nbsp;&nbsp;

00:03:26.160 --> 00:03:30.420
duration matching the value of its corresponding&nbsp;
element once all the threads have finished&nbsp;&nbsp;

00:03:30.420 --> 00:03:34.980
snoozing they wake up one by one and print their&nbsp;
elements value since the thread with the least&nbsp;&nbsp;

00:03:34.980 --> 00:03:39.300
amount of nap time will wake up first and the&nbsp;
largest will wake up last the Sorting technique&nbsp;&nbsp;

00:03:39.300 --> 00:03:44.700
will always sort in ascending order resulting in a&nbsp;
sorted list but this technique has some drawbacks&nbsp;&nbsp;

00:03:44.700 --> 00:03:52.380
suppose you have a list with the elements 1 and&nbsp;
999 999. it would take a million seconds just to&nbsp;&nbsp;

00:03:52.380 --> 00:03:57.840
sort those two numbers also this algorithm won't&nbsp;
work with negative numbers as threads can't sleep&nbsp;&nbsp;

00:03:57.840 --> 00:04:03.120
for a negative amount of time number three slow&nbsp;
sort slow sort is a recursive sorting algorithm&nbsp;&nbsp;

00:04:03.120 --> 00:04:07.800
that is based on a paradigm called multiply and&nbsp;
surrender which is a parody of the divide and&nbsp;&nbsp;

00:04:07.800 --> 00:04:12.480
conquer Paradigm slow sort is very similar to the&nbsp;
merge sort algorithm in the sense that they both&nbsp;&nbsp;

00:04:12.480 --> 00:04:17.340
break down the Sorting problem into smaller&nbsp;
sub-problems however unlike merge sort which&nbsp;&nbsp;

00:04:17.340 --> 00:04:22.440
efficiently combines and sorts the sublists slow&nbsp;
sort multiplies the problem and tries to delay the&nbsp;&nbsp;

00:04:22.440 --> 00:04:27.660
Sorting process as much as it can so here's how it&nbsp;
works slow sort takes the list breaks it into two&nbsp;&nbsp;

00:04:27.660 --> 00:04:33.300
and recursively sorts both halves next it compares&nbsp;
the rightmost number in each half and swaps them&nbsp;&nbsp;

00:04:33.300 --> 00:04:37.920
if the largest number lies in the first half&nbsp;
now it has the highest number in the whole array&nbsp;&nbsp;

00:04:37.920 --> 00:04:43.260
correctly placed in the last position this process&nbsp;
repeats recursively for every single element until&nbsp;&nbsp;

00:04:43.260 --> 00:04:49.860
the entire list is sorted number four BOGO sort&nbsp;
bogosort is a popular sorting algorithm that some&nbsp;&nbsp;

00:04:49.860 --> 00:04:54.900
people consider to be the absolute worst and for&nbsp;
good reason it works by randomly shuffling the&nbsp;&nbsp;

00:04:54.900 --> 00:04:59.580
elements in the list and checking if the list&nbsp;
is sorted if the list is not sorted it goes&nbsp;&nbsp;

00:04:59.580 --> 00:05:04.860
through the shuffling process again and again and&nbsp;
again and again and again until by pure luck the&nbsp;&nbsp;

00:05:04.860 --> 00:05:09.000
elements happen to be arranged in the correct&nbsp;
order although this algorithm is considered to&nbsp;&nbsp;

00:05:09.000 --> 00:05:14.040
be the absolute worst it is also considered to be&nbsp;
the absolute best because it has the possibility&nbsp;&nbsp;

00:05:14.040 --> 00:05:20.400
of sorting any list in one try but unless you're a&nbsp;
domino this algorithm is basically useless number&nbsp;&nbsp;

00:05:20.400 --> 00:05:26.520
five 5. Bozo sort bozosort is just like bogosaur&nbsp;
but instead of randomly shuffling the whole list&nbsp;&nbsp;

00:05:26.520 --> 00:05:31.260
we only take two random elements in the list swap&nbsp;
them with each other and check if the list is&nbsp;&nbsp;

00:05:31.260 --> 00:05:36.840
sorted if it's not sorted we just pick another two&nbsp;
elements at random and swap them and we just keep&nbsp;&nbsp;

00:05:36.840 --> 00:05:42.480
repeating this process until the list is sorted&nbsp;
number six BOGO BOGO sort I'm sure you're starting&nbsp;&nbsp;

00:05:42.480 --> 00:05:47.400
to see a pattern BOGO BOGO sort is basically&nbsp;
the ultimate supercharged hyper inefficient&nbsp;&nbsp;

00:05:47.400 --> 00:05:53.400
turbo Amplified recursive version of bogosaur this&nbsp;
sorting algorithm is so bad that it won't sort any&nbsp;&nbsp;

00:05:53.400 --> 00:05:59.160
sizeable list before the death of the universe&nbsp;
it's the biggest piece of dogsh*t works by BOGO&nbsp;&nbsp;

00:05:59.160 --> 00:06:04.140
sorting larger and larger subsets of the data set&nbsp;
until the data set itself is sorted here is an&nbsp;&nbsp;

00:06:04.140 --> 00:06:09.720
example of how BOGO bogosaur would sort this array&nbsp;
first it takes the first two elements and BOGO&nbsp;&nbsp;

00:06:09.720 --> 00:06:15.240
sorts them next it takes the first three elements&nbsp;
and BOGO sorts them and so on now if you think&nbsp;&nbsp;

00:06:15.240 --> 00:06:20.700
that's already bad enough it gets way worse if at&nbsp;
any point the data being sorted is out of order&nbsp;&nbsp;

00:06:20.700 --> 00:06:25.080
it starts all over from the very beginning&nbsp;
by vogelsorting the first two elements again

00:06:26.580 --> 00:06:34.020
number seven Quantum Vogel sort Quantum bogosort&nbsp;
is a sorting algorithm that is based on a concept&nbsp;&nbsp;

00:06:34.020 --> 00:06:39.000
in quantum mechanics called the mini world's&nbsp;
interpretation this concept suggests that every&nbsp;&nbsp;

00:06:39.000 --> 00:06:44.580
possible outcome of an event exists in a separate&nbsp;
and distinct parallel universe for example there&nbsp;&nbsp;

00:06:44.580 --> 00:06:49.020
might just be a parallel universe out there where&nbsp;
I'm actually a successful YouTuber and Quantum&nbsp;&nbsp;

00:06:49.020 --> 00:06:54.300
bogosaur we start by randomly shuffling the list&nbsp;
as we would in bogosort now by adding the concept&nbsp;&nbsp;

00:06:54.300 --> 00:06:58.860
of the mini world's interpretation we end up with&nbsp;
parallel universes where the list actually got&nbsp;&nbsp;

00:06:58.860 --> 00:07:04.200
sorted in one try and so we keep those universes&nbsp;
now can you guess what we do with those universes&nbsp;&nbsp;

00:07:04.200 --> 00:07:09.780
where the list remains unsorted we destroy&nbsp;
them along with every living thing number eight&nbsp;&nbsp;

00:07:09.780 --> 00:07:15.660
Schrodinger's sort Schrodinger sort is a sorting&nbsp;
algorithm that is based on the concept of quantum&nbsp;&nbsp;

00:07:15.660 --> 00:07:20.520
superposition in the thought experiment known as&nbsp;
Schrodinger's cat where the cat is both dead and&nbsp;&nbsp;

00:07:20.520 --> 00:07:25.440
alive at the same time this is another Concept in&nbsp;
quantum physics that describes a situation where&nbsp;&nbsp;

00:07:25.440 --> 00:07:30.540
a particle can exist and multiple States at once&nbsp;
and here's the weird part the particle will choose&nbsp;&nbsp;

00:07:30.540 --> 00:07:35.580
to be in one specific State once it is observed or&nbsp;
measured and that freaks me out to this day so in&nbsp;&nbsp;

00:07:35.580 --> 00:07:39.540
the case of Schrodinger's sort the elements in the&nbsp;
list are in a strange state where they are both&nbsp;&nbsp;

00:07:39.540 --> 00:07:45.480
sorted and unsorted at the same time number nine&nbsp;
intelligent design sort intelligent design sort&nbsp;&nbsp;

00:07:45.480 --> 00:07:50.400
is a sorting algorithm that mocks the argument of&nbsp;
intelligent design this argument suggests that a&nbsp;&nbsp;

00:07:50.400 --> 00:07:54.960
supernatural and intelligent designer purposefully&nbsp;
created the features and aspects of the universe&nbsp;&nbsp;

00:07:54.960 --> 00:07:59.940
considering them too complex to have occurred&nbsp;
by mere chance or natural processes intelligent&nbsp;&nbsp;

00:07:59.940 --> 00:08:04.200
design sort doesn't really sort anything it&nbsp;
just says that the original input list being&nbsp;&nbsp;

00:08:04.200 --> 00:08:09.480
in its exact order has a probability of 1 over&nbsp;
n factorial making it highly unlikely to have&nbsp;&nbsp;

00:08:09.480 --> 00:08:15.720
happen by chance coincidence I think not and so&nbsp;
it is therefore absurd to suggest that it occurred&nbsp;&nbsp;

00:08:15.720 --> 00:08:20.640
randomly and it is more reasonable to assume an&nbsp;
intelligent sorter must have deliberately arranged&nbsp;&nbsp;

00:08:20.640 --> 00:08:27.300
it so no work needs to be done and last but not&nbsp;
least at number 10 is Miracle sort miracle is an&nbsp;&nbsp;

00:08:27.300 --> 00:08:33.660
algorithm that relies on you guessed it a miracle&nbsp;
to sort an unordered list it goes like this we&nbsp;&nbsp;

00:08:33.660 --> 00:08:38.220
start by creating an array and checking if it's&nbsp;
already sorted if it's not we patiently wait for a&nbsp;&nbsp;

00:08:38.220 --> 00:08:42.960
while and check again later and we keep repeating&nbsp;
this process without making any changes to the&nbsp;&nbsp;

00:08:42.960 --> 00:08:48.720
list all we do is continuously check and hope and&nbsp;
pray that by some miraculous intervention the bits&nbsp;&nbsp;

00:08:48.720 --> 00:08:52.980
and the computer will undergo a transformation&nbsp;
that magically brings the array into a sordid&nbsp;&nbsp;

00:08:52.980 --> 00:08:58.500
State and there you have it we've just explored&nbsp;
the 10 most absurd sorting algorithms I'm sure&nbsp;&nbsp;

00:08:58.500 --> 00:09:02.100
there's more out there that I'm not aware of if&nbsp;
you know any that didn't make it to this list&nbsp;&nbsp;

00:09:02.100 --> 00:09:06.840
let me know in the comments and also try to come&nbsp;
up with your own original and ridiculous sorting&nbsp;&nbsp;

00:09:06.840 --> 00:09:11.640
algorithm I look forward to reading your creative&nbsp;
concoctions and also also don't forget to check&nbsp;&nbsp;

00:09:11.640 --> 00:09:16.800
out the flexispot E7 standing desk it offers&nbsp;
great quality at a reasonable price subscribe&nbsp;&nbsp;

00:09:16.800 --> 00:09:21.940
and join the Discord if you haven't already&nbsp;
I'll see you in the next one take care [Music]

00:09:31.140 --> 00:09:40.800
thank you

